Skip to content

Commit

Permalink
Add support to Disqus
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Pufal committed Aug 25, 2016
1 parent 1e20bd3 commit a2f1b11
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
19 changes: 19 additions & 0 deletions _includes/disqus_comments.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{% if page.comments %}
<div id="disqus_thread"></div>
<script>
var disqus_config = function () {
this.page.url = '{{ site.url }}{{ page.url }}'; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = '{{ site.url }}{{ page.url }}'; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};

(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');

s.src = '//{{ site.disqus.shortname }}.disqus.com/embed.js';

s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
{% endif %}
3 changes: 3 additions & 0 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ <h1 class="post-title" itemprop="name headline">{{ page.title | escape }}</h1>
{{ content }}
</div>

{% if site.disqus.shortname %}
{% include disqus_comments.html %}
{% endif %}
</article>

0 comments on commit a2f1b11

Please sign in to comment.