Overview
Disqus is a free, hosted commenting system you can drop into your Jekyll site. With Disqus, we can add commenting to a blog or other pages in a couple of minutes.
Instructions
- Register your site with Disqus.
-
Copy the Universal Embed code below
<div id="disqus_thread"></div> <script> var disqus_shortname = '{{ site.disqus_shortname }}'; var disqus_config = function () { this.page.url = "{{ page.url | prepend: site.url }}"; this.page.identifier = "{{ page.id }}"; }; (function() { // DON'T EDIT BELOW THIS LINE 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>
- Paste it into your post layout.
-
Set
url
to your site’s domain anddisqus_shortname
to your shortname in_config.yml
... url: http://mysite.com disqus_shortname: YOUR_DISQUS_SHORTNAME
Turn off commenting
If we wanted to disable commenting on particular pages we could set comments: false
in front matter the surround the Universal Embed code with an if statement:
...
{% if page.comments != false %}
...
{% endif %}
...