How to add a comments section to your static bloglearning static
11 Nov 2019
3 minute read
Usually, blogs store comment data inside their server database. You can’t do that with static websites but there are many tools that can help you solve this problem and create discussion around your posts. This article will guide you through some ways you can add these comments for free.
For Developers - Utterances
Utterances is a great comment plugin built on Github issues. It creates an issue on github for your posts and then adds your website’s comments to the issues. All your commenters need to do is sign in on Github. Obviously, you should only do this if your blog is about software development or a related subject otherwise none of your readers will have Github accounts.
I love this solution because it’s an opensource and lightweight tool that doesn’t harm the user experience. It’s a simple option and it has a beautiful user interface which you can see down below.
How to get it setup:
- Create a public “myblog-comments” repository on Github
- Add the app to your repo on the github utterance page
- Paste the following snippet at the bottom of all of your posts:
<script src="https://utteranc.es/client.js" repo="[username/myblog-comments]" issue-term="pathname" theme="github-light" crossorigin="anonymous" async> </script>
and replace the repo value with the name of your repository. You can customize this snippet more at the bottom of the utterances website.
Disqus is a technically free way to add to comments to your website. It’s a useful tool but I don’t use it because it injects ads into your website if you use the free plan and it raises privacy concerns for its users.
- Register an account at Disqus
- Confirm that you want to install Disqus on your site
- Choose your plan
- On the choose your platform window, select the “Universal Code” option
- Embed the following code at the bottom of your posts:
Remember to replace the page url and identifier parameters with those of your posts. Also replace the s.src “websitename” part with the website name you registered with Disqus. If your site is “example.com”, it would be “example.disqus.com/embed.js”
Your comments should now work, but please keep in mind the intangible price of Disqus outlined in this article.
Remarkbox is a simple third-party comment system similar to Disqus which is very easy to implement. Here’s how you can set it up:
- Enter your email in the Remarkbox signup form
- Click the link from the email you should have received from Remarkbox (it might be in spam)
- Follow the instructions on the
setuppage and embed your comment snippet.
Your Remarkbox comments should now be working. This system does not contain ads and respects user privacy more than Disqus but the free plan does not allow moderation and it is a rudimentary solution.
I hope you enjoyed this tutorial and if you encountered any problems with setting things up, please comment down below.