/ Ghost

Adding a comment section to Ghost without Disqus or Facebook

Welcome to my second blog post! In the following I'll show you the most easy way of adding a comment section to your own Ghost blog using ISSO as comment server in a Docker container. Thus, there is no need to give data to third parties like Facebook or Disqus. Moreover, visitors of your blog don't have to create an account somewhere to write comments and last but not least, you have full control over the comment system (configuration etc.).

Getting started

First of all, we need to create the docker container and run it, so the default folder structure gets created:

docker run -d --name=isso -p 10002:8080 -v /var/lib/isso/config:/config -v /var/lib/isso/db:/db wonderfall/isso:latest

The container will stop with exit code 1, since we haven't defined any sites yet.

Creating a configuration

That being said, we need to create a new file called isso.conf in the /var/lib/isso/config/ folder with the following content:

[general]
dbpath = /db/comments.db
host = https://blog.alexanderschaefer.io/
max-age = 15d
[moderation]
enabled = false
[guard]
enabled = false
[server]
listen = http://0.0.0.0:8080/
reload = off
profile = off

Remember to change the host URL to the URL of your blog.
Moreover, this is just an example configuration I am using for this blog, you can configure your comment system on your own using the official ISSO documentation.
Finally, start the container and after that your ISSO server should be available under somedomain.com:10002!

Adding ISSO to Ghost

Ghost offers a very feature-rich theme system which allows themes to be edited and customized in a very easy way. In our example we will use the default Ghost theme and add a comment section to it, however you can try it with the theme of your choice.
First of all, download the latest version of the official Ghost theme from the Casper Github repository.
Next, edit the post.hbs file and remove all code inside the <section class="post-full-comments"> section since this is code for Disqus. We need to replace it with the ISSO client script:

<section class="post-full-comments">
    <script
      data-isso="https://comments.alexanderschaefer.io/"
      data-isso-lang="en"
      data-isso-vote="false"
      src="//comments.alexanderschaefer.io/js/embed.min.js"></script>
    <section id="isso-thread"></section>
</section>

Remember to change the data-isso attribute to the URL of your comment server, e.g. somedomain.com:10002.
Moreover, this is just an example configuration I am using for this blog, you may configure the client script on your own using the official ISSO documentation.

Activate the theme

Last but not least, upload your edited theme to your Ghost blog and activate it. You can do this in the Design section of your Ghost dashboard.

themeupload

Keep in touch

Thank you for reading! Feel free to comment if you have any questions, ideas or just want to talk to me and remember to check out my other posts.