constance

Scripts for generating (an earlier obsolete version of) my personal web site
git clone https://code.djc.id.au/git/constance/
commit 732f74b3119a03bcfab32fe1891dc4f3427f7126
parent 8db3c1041de5c3dfaa1ec3d8ce7f2c8307817852
Author: Sam Kingston <sam@sjkwi.com.au>
Date:   Sun, 10 Oct 2010 19:44:56 +1000

moved disqus username to config - if this option isn't present comments are disabled

Diffstat:
Mconstance.py | 1+
Mtemplates/blog/entry.html | 6++++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/constance.py b/constance.py
@@ -39,6 +39,7 @@ xslt = ./style.xsl
 [template]
 website = http://localhost
 email = user@domain.com
+disqus_user = 
 """
 
 def main():
diff --git a/templates/blog/entry.html b/templates/blog/entry.html
@@ -25,15 +25,17 @@ from viewutils import tag_list
             ${item.body}
         </div>
 
+        <py:if test="template_config.get('disqus_user') is not None and template_config.get('disqus_user') != ''">
         <div id="disqus_thread"></div>
         <script type="text/javascript">
           (function() {
            var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
-           dsq.src = 'http://djc.disqus.com/embed.js';
+           dsq.src = 'http://${template_config.get("disqus_user")}.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=djc">comments powered by Disqus.</a></noscript>
+        <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript=${template_config.get('disqus_user')}">comments powered by Disqus.</a></noscript>
+        </py:if>
 
     </div>
 </body>