Allow Disqus comments to be collapsed (again)
diff --git a/templates/article.html b/templates/article.html
index b4108b6..0a7c43b 100644
--- a/templates/article.html
+++ b/templates/article.html
@@ -47,18 +47,27 @@
</div>
{% if DISQUS_SITENAME %}
- <div id="article_comments">
- <div id="disqus_thread"></div>
- <script type="text/javascript">
- var disqus_identifier = "{{ article.url }}";
- (function() {
- var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
- dsq.src = '//{{ DISQUS_SITENAME }}.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>
+ <div id="article_comments">
+ <div id="disqus_thread">
+ {% if DISQUS_COLLAPSED %}
+ <a href="javascript:loadDisqus()"><i class="fa fa-comments fa-lg"></i>Click to load comments</a>
+ {% endif %}
</div>
+ </div>
+
+ <script type="text/javascript">
+ var disqus_identifier = "{{ article.url }}";
+ loadDisqus = function() {
+ var dsq = document.createElement('script');
+ dsq.type = 'text/javascript';
+ dsq.async = true;
+ dsq.src = '//{{ DISQUS_SITENAME }}.disqus.com/embed.js';
+ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
+ };
+ {% if not DISQUS_COLLAPSED %}
+ loadDisqus();
+ {% endif %}
+ </script>
{% endif %}
</article>
{% endblock %}