-
-
Save koolamusic/24b2280440b71a397ffb77a41bf3f577 to your computer and use it in GitHub Desktop.
Jekyll include file to integrate disqus comments.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if site.disqus_short_name and page.comments != false %} | |
<div id="disqus_thread"></div> | |
<script> | |
var disqus_shortname = '{{ site.disqus_short_name }}'; | |
var disqus_config = function () { | |
// _config.yml should define the site's URL | |
this.page.url = '{{ site.url }}{{ page.url }}'; | |
// Using an optional disqus_identifier variable, or the site.url + page.id combination | |
this.page.identifier = '{% if page.disqus_identifier %}{{ page.disqus_identifier}}{% else %}{{ site.url }}{{ page.id }}{% endif %}'; | |
}; | |
(function() { | |
var d = document, s = d.createElement('script'); | |
s.src = '//' + 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 %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Refer also to this guide https://poanchen.github.io/blog/2017/07/27/how-to-add-disqus-to-your-jekyll-site