aboutsummaryrefslogtreecommitdiffstats
path: root/monospace
diff options
context:
space:
mode:
authorTom Pollard <tom.pollard.11@ucl.ac.uk>2014-07-02 15:00:34 +0100
committerTom Pollard <tom.pollard.11@ucl.ac.uk>2014-07-02 20:32:55 +0100
commit448457fb4ccdc6eb0e4190d009ee23ef996a8ecb (patch)
tree8701e0fcb7aff44329c50b88e91a8c672a381354 /monospace
parent2074d08fad36f9e39218526c3936d9e7857aa071 (diff)
downloadpelican-themes-448457fb4ccdc6eb0e4190d009ee23ef996a8ecb.zip
pelican-themes-448457fb4ccdc6eb0e4190d009ee23ef996a8ecb.tar.gz
pelican-themes-448457fb4ccdc6eb0e4190d009ee23ef996a8ecb.tar.bz2
Add Disqus comments to articles
Diffstat (limited to 'monospace')
-rw-r--r--monospace/templates/article.html17
1 files changed, 17 insertions, 0 deletions
diff --git a/monospace/templates/article.html b/monospace/templates/article.html
index 9758fdc..722e5c5 100644
--- a/monospace/templates/article.html
+++ b/monospace/templates/article.html
@@ -8,5 +8,22 @@
</header>
<article>
{{ article.content }}
+ {% if DISQUS_SITENAME and SITEURL and article.status != "draft" %}
+ <h2>Comments</h2>
+ <div id="disqus_thread"></div>
+ <script type="text/javascript">
+ var disqus_shortname = '{{ DISQUS_SITENAME }}';
+ var disqus_identifier = '{{ article.url }}';
+ var disqus_url = '{{ SITEURL }}/{{ article.url }}';
+ (function() {
+ 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 comments.</noscript>
+ {% endif %}
</article>
{% endblock %}