Commentbox is a slim alternative to Disqus. Lets add it to Jekyll.

Edit “_config.yml” and add the following lines, where “id” comes from your Commentbox dashboard:

commentbox:
 id: XXXXXXXXXXXXX-proj

Create “_includes/commentbox.html” as follows:


{%- if page.comments != false  -%}
  <div class="commentbox"></div>
  <script src="https://unpkg.com/commentbox.io/dist/commentBox.min.js"></script>
  <script>
    commentBox('{{ site.commentbox.id }}');
  </script>
  <noscript>Please enable JavaScript to view the comments.</noscript>
{%- endif -%}

In your post layout, “_layouts/post.html”, include “commentbox.html” after the content:


  <div class="post-content e-content" itemprop="articleBody">
    {{ content }}
  </div>

  {%- if site.commentbox.id -%}
    {%- include commentbox.html -%}
  {%- endif -%}"

That’s it!

References