Created
May 17, 2019 07:29
-
-
Save piotrpog/7d259f4e167793acc4b30adaa19bcef1 to your computer and use it in GitHub Desktop.
Disqus integration for Craft CMS. More info: http://craftsnippets.com/articles/adding-disqus-comments-to-craft-cms-website
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
{% set shortname = 'YOUR_WEBSITE_SHORTNAME' %} | |
{% if entry is defined %} | |
<div id="disqus_thread"></div> | |
<script> | |
var disqus_config = function () { | |
this.page.url = '{{entry.url}}'; | |
this.page.identifier = '{{entry.id}}'; | |
this.page.title = '{{entry.title}}'; | |
}; | |
(function() { // DON'T EDIT BELOW THIS LINE | |
var d = document, s = d.createElement('script'); | |
s.src = 'https://{{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 comments.'|t}}</noscript> | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment