Skip to content

Add comments to your blog

Eduardo Gómez edited this page Aug 20, 2022 · 4 revisions

Native comments

Native commenting support was introduced in version 2.1.0 of the theme, this feature allows you to invite members to join the discussion and participate in a community directly on your website.

This feature is disabled by default, if you want to use it you have to enable it first, you can do it in the Ghost Admin, under the Membership settings:

CleanShot 2022-08-20 at 22 20 46

If you want to implement anonymous commenting, require other advanced commenting features, keep reading.

Third-party comments

Liebling is also compatible with third-party solutions, you can use any of the available Ghost integrations, the installation is usually quite simple, below you can see an example of how to add Disqus comments to your blog. The setup process for other solutions is pretty much the same.

Disqus

Liebling integrates perfectly with Disqus, all you have to do is the following:

  1. After creating an account in Disqus, you will have to create a new site in the admin of that platform.

  2. You must copy the shortname of your new site, this can be found in the preferences of your new site.

  1. You will have to unzip the theme file and open the file post.hbs with a code editor. You have to comment out the following lines of code:
{{!--
  <section class="m-comments">
    <div class="l-wrapper in-comments js-third-party-comments">
      <!-- Paste here the provided code snippet -->
    </div>
  </section>
--}}
  1. Now you have to replace <!-- Paste here the provided code snippet --> with this:
<div id="disqus_thread"></div>
<script>
  var disqus_config = function () {
    this.page.url = "{{url absolute="true"}}";
    this.page.identifier = "ghost-{{comment_id}}"
  };
  (function () {
    var d = document, s = d.createElement('script');
    s.src = 'https://CHANGETHIS.disqus.com/embed.js';
    s.setAttribute('data-timestamp', +new Date());
    (d.head || d.body).appendChild(s);
  })();
</script>
  1. Inside that piece of code look for the next line:
s.src = 'https://CHANGETHIS.disqus.com/embed.js';

Replace CHANGETHIS with your shortname.

Finally save the file, zip the theme folder and upload it again.