Skip to content

Instantly share code, notes, and snippets.

@igorkulman
Last active June 4, 2017 14:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igorkulman/47e9d4dc4bbb5279267a58d7bc794944 to your computer and use it in GitHub Desktop.
Save igorkulman/47e9d4dc4bbb5279267a58d7bc794944 to your computer and use it in GitHub Desktop.
<div class="disqus-comments">
<button id="show-comments" class="btn btn-default" type="button">Show <span class="disqus-comment-count" data-disqus-url="{{ trim .Permalink "/" }}">comments</span></button>
<div id="disqus_thread"></div>
</div>
var disqus_config = function () {
this.page.url = '{{ trim .Permalink "/" }}';
};
<script id="dsq-count-scr" src="//{{.Site.DisqusShortname}}.disqus.com/count.js" async></script>
$(function(){
$('#show-comments').on('click', function(){
var disqus_shortname = '{{.Site.DisqusShortname}}';
(function() {
var disqus = document.createElement('script');
disqus.type = 'text/javascript';
disqus.async = true;
disqus.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(disqus);
})();
$(this).hide(); // Hide the button
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment