Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Disqus include modifier to allow comment count to display.

  • Loading branch information...
commit acf37c270a60eab73ed5f78ffa299a8c16042455 1 parent 9bfac6b
Cale Mooth authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 source/_includes/disqus.html
View
8 source/_includes/disqus.html
@@ -1,22 +1,22 @@
{% comment %} Load script if disquss comments are enabled and `page.comments` is either empty (index) or set to true {% endcomment %}
{% if site.disqus_short_name and page.comments != false %}
<script type="text/javascript">
- (function () {
var disqus_shortname = '{{ site.disqus_short_name }}';
{% if page.comments == true %}
{% comment %} `page.comments` can be only be set to true on pages/posts, so we embed the comments here. {% endcomment %}
// var disqus_developer = 1;
var disqus_identifier = '{{ site.url }}{{ page.url }}';
var disqus_url = '{{ site.url }}{{ page.url }}';
- var disqus_script = 'embed.js'
+ var disqus_script = 'embed.js';
{% else %}
{% comment %} As `page.comments` is empty, we must be on the index page. {% endcomment %}
- var disqus_script = 'count.js'
+ var disqus_script = 'count.js';
{% endif %}
+ (function () {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/' + disqus_script;
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
}());
</script>
-{% endif %}
+{% endif %}
Please sign in to comment.
Something went wrong with that request. Please try again.