Various ways to include comments on your static site
Static site generators like Eleventy, Jekyll or Hugo have become a popular choice for a blogging platform or a CMS. When using something like WordPress or Medium you get a comment section out of the box. It is not as straightforward in a static environment. In this article, I will summarize different options to provide your audience with a way to leave a comment.
Table of contents:
Here are some common third-party providers:
- Disqus. Probably the most popular comment hosting service. It offers a basic ads-supported plan, but it comes with some privacy, security and performance problems.
- Facebook comments. Another established provider with similar privacy concerns as Disqus.
- Muut. Small and ad-free, but I was unable to find a free tier. Starts at 16$/month, which may not be worth it for a small blog.
- Remarkbox. Offered as a "pay what you can" service.
- JustComments. A pay-as-you-go service, so your monthly expenses depend on your page views. Starts at 5$/month. A basic version can be self-hosted.
- CommentBox. Offers a free plan with 100 comments per month. The pricing for unlimited comments starts at 10$/month.
- HyperComments. Another page view-based service. Starts at 2$/month for a single site.
- GraphComments. Starts with a generous 1M page views per month free tier. However, a Facebook script is injected, which leads to privacy concerns.
- FastComments. No free tier, starts at 5$/month.
- Hyvor Talk. Premium only, starts at 5$ per month.
- ReplyBox. Starts at 6$/month for 20.000 monthly page views.
- Caint. A free open-source comment service.
- Cusdis. A lightweight, privacy-first and open-source project. Paid plans are not yet available.
- Chirpy. A privacy-friendly, customizable and open-source service. Public beta as of April 2022.
When you care about your website's performance but don't want to miss the convenience of third-party services, you may want to outsource the comments completely. The implementation effort is as low as including an external link at the end of your articles.
One downside of this approach is data ownership. "Big Tech" is known for banning accounts and/or removing posts at will. Whether this is a viable option also depends on your reader's demographics.
- Mastodon or Twitter. For every blog post, include a link back to your social media post, where people can leave their comments.
- Reddit. Create your own subreddit and post a link to every new blog article. As a bonus, your posts can be voted on, so you get a nice popularity overview.
- Hacker News. Similar to Reddit, but aimed towards a more technical audience. You can't create a dedicated space for your links, but it's possible to view all posts per domain.
Self-hosting blog comments solves many 3rd party issues as you're in charge of everything. This also means that you have to take over the whole administration process, including spam protection (or delegate this issue to another service like Akismet).
- Discourse. It's a whole discussion platform, mostly used to replace classic discussion boards. It can also be utilized to host comments, as used by the co-founder Jeff Atwood on their static blog.
- Talkyard. Similar to Discourse. It combines a forum, Q&A, chat and blog comments. Talkyard also comes with affordable hosted plans starting at 0.5 €/month.
- Coral / Talk. Built by Mozilla and some leading news websites.
- Cactus Comments. Federated comment system, based on the Matrix protocol.
- Isso. Exists since 2013 and with 4400+ GitHub stars, it's one of the most popular "indie" projects, i.e., not backed by a major organization. Unfortunately, I had some problems getting it to run in 2016.
- Juvia. One of the oldest (2011) yet still maintained open-source commenting systems.
- Commento. A self-called "privacy-focused Disqus alternative". Created in November 2017, with 3500+ GitHub stars. A hosted version is available.
- Schnack. Another self-hosted option, with 1700+ stars on GitHub. Offers moderation and comments import from Disqus and WordPress.
- Remark42. With 2.8k+ stars, it's a popular alternative that is actively maintained and extended.
- Comntr. A new open source project. It is an integrated 3rd party tool that can be run like a self hosted solution.
- Glosa. An underrated open source project. Offers importing comments from Disqus.
- Komento. A decentralized comment hosting powered by IPFS. As of April 2021, it's in Beta phase.
- HashOver. A free and open source PHP comment system designed for completely anonymous comments with custom themes.
Given all the options, there's probably no need to reinvent the wheel. But if existing tools don't match your requirements, you can implement your own solution. Here are some DIY write-ups for inspiration:
- Static HTML comments, by Derek Sivers
- Deriving comments from web server logs
If you're targeting software developers, consider using GitHub for comments. Create a GitHub issue for each blog post and load the issue comments on your site. Here are some related open-source tools:
- Utterances. A lightweight comments widget built on GitHub issues. Actively maintained as of May 2021.
- Giscus. A comment system powered by GitHub discussions. Heavily inspired by Utterances and actively maintained.
- Gitment. A comment system based on GitHub issues. Not maintained since 2018.
For a broader audience, you can still utilize GitHub without a required account. Staticman first turns comments into a format like JSON or YAML. Then, it either commits them automatically into your git repository, or it creates a pull request (if you prefer comment moderation).
IndieWeb and Fediverse
As part of the IndieWeb community, webmentions are a federated/decentralized way to share comments, likes and other human interactions. It's rather a technical topic, so check out Sebastian De Deyne's blog post for more information.
Another approach is to connect your site to the Fediverse. For example, you can fetch and display Mastodon comments, as described in Carl Schwan's write-up.
Finally, removing comments altogether is also an option. In 2020, I've replaced the comment section with a note to contact me via email or social media. I haven't noticed a difference in the valuable comments and questions that people send me.
Jeff Atwood claims that a blog without comments is not a blog. Sure, he gets hundreds of comments, and he has built a big community around it. But this may not apply to everyone. Leo Babauta from Zen Habits turned off comments, so he could spend more time creating content than moderating comment spam.
The middle ground
In the first few years of blogging, I've received only ~2 real user comments per month. That's way too little interaction to invest much time into a self-hosted solution. But I've still cared about the (at least initial) page load, so I've chosen a middle ground. I've placed a "Load comments" button, so nothing gets loaded unless the user clicks on it.
You can apply this to most of the methods mentioned in this article.
I've presented different techniques to include comments on a static website. Which option should you choose for your site? There is no silver bullet. The best method depends on your requirements:
- How much time are you prepared to invest in the setup/moderation?
- How important is performance/privacy/data ownership to you?
- Who is your target audience?
- Do you want to build a community?
Any thoughts? Did I miss something? Leave a comment (no pun intended).