Commits

faassen committed 9fcb72d

Use disqus_name to configure templates instead of having this hardcoded.

Comments (0)

Files changed (3)

 
     title = config.get('content', 'title')
 
+    disqus_name = config.get('disqus', 'name')
+    
     defaults = {
-        'disqus_name': config.get('disqus', 'name'),
+        'disqus_name': disqus_name,
         'css': config.get('html', 'css_url') + "?" + str(int(time())), #force reload. 
         'page_title': title,
         'blaag_title': title,
 
         with open(os.path.join(html_path, htmltitle, "index.html"), "w") as target:
             #Write page for post
-            fullcomments = comments_full_tpl.substitute(parts, threadid=htmltitle)
+            fullcomments = comments_full_tpl.substitute(
+                parts,
+                threadid=htmltitle,
+                disqus_name=disqus_name)
             blaag_html = blaag_tpl.substitute(parts, comments=fullcomments)
             target.write(page_tpl.substitute(parts, title=parts['title'], 
-                                             links=links, main=blaag_html).encode("utf-8"))
+                                             links=links,
+                                             main=blaag_html,
+                                             disqus_name=disqus_name).encode("utf-8"))
             #Append post to main page
             shortcomments = comments_short_tpl.substitute(parts, 
                                                           link=get_url(parts), 

templates/comments_full.html

     <div id="disqus_thread"></div>
     <script type="text/javascript">
         /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
-        var disqus_shortname = 'devrantblaag'; // required: replace example with your forum shortname
+        var disqus_shortname = '${disqus_name}';
         var disqus_identifier = '${threadid}';
         /* * * DON'T EDIT BELOW THIS LINE * * */
-        (function() {
+        (function(d) {
             var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
             dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
             (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
     </script>
     <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
     <a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
-</div>
+</div>

templates/pagetemplate.html

     </script>
      
     <script type="text/javascript">
-      var disqus_shortname = 'devrantblaag'; 
+      var disqus_shortname = '${disqus_name}'; 
       (function () {
         var s = document.createElement('script'); s.async = true;
         s.type = 'text/javascript';
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.