Skip to content

Commit

Permalink
Emit disqus comments only in post pages.
Browse files Browse the repository at this point in the history
  • Loading branch information
le4ker committed Oct 3, 2015
1 parent 6bcb7ca commit 3a643b0
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions _includes/js.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,20 @@
</script>
{% endif %}

<!-- Disqus -->

{% if site.disqus-shortname %}
<script type="text/javascript">
var disqus_shortname = '{{ site.disqus-shortname }}';
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<!-- Disqus -->

{% if page.section-type == "post" %}
<script type="text/javascript">
var disqus_shortname = '{{ site.disqus-shortname }}';
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
{% endif %}

{% if page.section-type == "post" or page.section-type == "blog" or page.section-type == "index" or page.section-type == "tag" %}
<!-- Comments counter -->
Expand Down

0 comments on commit 3a643b0

Please sign in to comment.