Skip to content

Commit

Permalink
Added Disqus Comments! Fixes #14
Browse files Browse the repository at this point in the history
  • Loading branch information
curiositry committed Oct 28, 2014
1 parent d3d93d9 commit 5c044c4
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
35 changes: 35 additions & 0 deletions partials/comments.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<section class="post-comments">
<button class="show-comments btn--full-width" id="show-comments" onclick="loadComments();"><a href="{{url}}#disqus_thread">Load Comments</a></button>

<!-- The empty element required for Disqus to loads comments into -->
<div id="disqus_thread"></div>
<noscript>Please enable JavaScript to view the <a rel="nofollow" href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a rel="nofollow" href="http://disqus.com" class="dsq-brlink m0a"><em>comments powered by <span class="logo-disqus">Disqus</span></em></a>


<script type="text/javascript">
// EDIT THIS LINE!
var disqus_shortname = 'YOUR_DISQUS_SHORTNAME'; // You *must* replace this with your shortname
var disqus_identifier = '{{uuid}}';
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
function loadComments() {
(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);
})();
document.getElementById('show-comments').style.display = "none";
}
</script>
</section>
3 changes: 2 additions & 1 deletion post.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@
</section>

</footer>

{{/post}}
<!-- If you want Disqus comments, uncomment this. Make sure to set your disqus shortname in partials/comments.hbs first! -->
{{!>comments}}
</article>

</main>

0 comments on commit 5c044c4

Please sign in to comment.