Turning comments on

Table of contents

Why

I’ve been contemplating turning on comments for a while now. I do occasionally get emails from some readers, not often, but it happens. I really appreciate the feedback and reading about other peoples setups and solutions. Comments are a double-edged sword — it might make it easier for engaged readers to leave their feedback, ideas, and corrections. But it might also attract spam and low-quality comments.

After careful consideration; I decided to turn comments on. Should they turn out to no be useful, I can simply turn them back off.

Which one

Seeing as this is a static website, “native comments” is not a thing. So the hunt was on for a commenting system or service. The most common, which Hugo actually has an internal template for, is Disqus. That was not going to happen — the amount of bloat, advertising, tracking, and general privacy issues that Disqus adds makes it a no-go for me.

So what then? I had a few requirements;

I found several sources online listing Disqus alternatives — these were the ones I ended up evaluating:

Isso

images/screenshot_isso.png

I know I said I didn’t want to self-host, but I gave Isso a go anyway. It was easy to get it up and running — it’s written in Python and uses an SQLite database. I didn’t like how it looked, it seemed a bit outdated, and it was not as lightweight as I would have liked. So I moved on.

TalkYard

images/screenshot_talkyard.jpg

I initially got quite excited about TalkYard; it’s open-source and available as a service. With a very generous, but a bit confusing, pricing model — pay what you want, at least €0.5, for up to 100 new comments, per month. With the first 100 comments being free! It did, however, feel a bit clunky, pulling in multiple external libraries and adding 140 KB of page weight. The blog comments are just a small part of a large community-like system; it felt a bit overkill for my use-case. On the positive side; the developer was quick to respond to my questions and fix a couple of issues that I found and reported.

utterances

images/screenshot_utterances.png

utterances is a bit different. It utilizes GitHub issues as comments, so each post gets created as an issue, and the conversations become comments. Clever! However, it means that a GitHub account is required for leaving comments, and it’s subject to the GitHub API rate limits. The markdown support and moderation tools are excellent, because; Github issues. However, I didn’t want to integrate that tightly with Github, seeing as my website lives on GitLab.

JustComments

images/screenshot_just-comments.png

JustComments was a pleasant surprise, it’s lightweight, only loading comments if the user scrolls down. And the pricing model is based on the number of page views, making it very cost effecting for low traffic sites, like mine. The developer was also very responsive. However, it lacked a few things I wanted; like proper moderation tools and post previews. It does have moderation; it’s just not very advanced. You can hide “bad” comments; either with a link in the email notification or by looking up the comment ID. Emailing with the developer — I found out that both these things are on the road-map. 👍

Staticman

images/staticman.png

I got a bit overwhelmed by the number of moving parts required with Staticman. It’s very different from the others, in that comments are posted to an API which stores them as data files — which are included when the site is built. Dynamic comments, as static content. It’s not a turn-key solution, and I wasn’t up for spending time implanting it. I might, however, re-evaluate it in the future. Keeping all comments stored as data files, together with the source, and without any 3rd party service is pretty neat!

Commento

images/screenshot_commento.png

Lastly, I tried Commento, and I liked it; it’s open-source, privacy-focused, lightweight, has spam filtering and is available as a service. The pricing model is “pay what you want,” with a minimum of $3. It has even received a Mozilla Open Source Support award in recognition of its contributions in making the internet more privacy-friendly. Sweet! I also found this excellent post comparing Disqus and Commento; it’s worth a read.

I really wanted to use Commento, but there were a few things that held me back. I tried to reach the developer on the support email, and Twitter — to no avail. I didn’t get any response. Looking at the status page, it seemed to me that the service was not that stable or performant. Last three weeks the API have been all yellow (partially degraded performance 👎). I even experienced the certificate for the status page expiring. I posted an issue, and the developer was quick to respond and corrected it.

images/screenshot_commento-status.png

Showdown

For me — the choice stood between JustComments and Commento, because:

JustComments
Simplistic, sets out to solve one task — comments.
Pay-as-you-go pricing model.
Responsive and friendly developer.
Active development, with new features on the road-map.
Light-weight.
Commento
Open-source.
Can be self-hosted.
Pay what you want pricing model.
Spam filtering.
Light-weight.

Let’s make a comparison:

Area JustComments Commento
Open-source Only the front-end Yes!
Self-hosted No Yes!
Privacy-friendly Yes! Yes!
Weight 22 KB 11 KB
Pricing Pay-as-you-go, $0.3 = 20k loads What you want, minimum $3
API Yes Coming soon
Data export Only through API Yes
Voting No, but on road-map Yes
Preview No, but on road-map Yes
Markdown Yes Yes
Editing No — admin edit on road-map Yes
Syntax highlighting By including highlight.js Yes
Custom page ID Yes No
Moderation Limited, improvement on road-map Yes
Email notifications Yes Yes
Spam filtering reCAPTCHA — Akismet on road-map Akismet
OAuth Twitter — Facebook on road-map Twitter, Facebook, GitLab, Github
Developer responsiveness Excellent, hours, even minutes No response on email or Twitter
Service quality Looks good, AWS serverless Questionable, looks like Digital Ocean
Back-end stack AWS serverless, DynamoDB Go, PostgreSQL

In many (most?) areas, Commento comes out on top. But it fails in two crucial areas — developer responsiveness and service quality. Having emailed quite a bit with Alex, the creator of JustComments, I am confident that the product is on the right track.

Implementation

To add JustComments to my Hugo website, I created a partial, which I added to my single.html layout.

{{- $url := urls.Parse .Site.BaseURL -}}
{{- $host := index (split $url.Host ":") 0 -}}
{{- $path := default .RelPermalink .Params.commentUrl }}
<div class="just-comments"
     data-pageid="{{ printf "%s%s" $host $path }}"
     data-allowguests="true"
     data-disablesharebutton="true"
     data-enableemailnotifications="true"
     data-apikey="my-api-key-from-dashboard">
</div>
<script async src="https://just-comments.com/w.js"></script>

I’m setting the data-pageid to domain/slug/, with the option of overriding the slug in the page frontmatter. That way I can keep the comments, even if a page gets moved or renamed.

Why not self-host?

I’m a big fan of self-hosting and making pieces of code talk to other pieces of code. But I didn’t want to self-host comments, for a couple of reasons;

Afterword

So comments are on — I’ve also added an email link on all pages. To make it easy to give feedback or ask questions for those that don’t feel like commenting.

Is it valuable to have comments turned on? I don’t know yet. But I suspect I will find out. Hopefully, they will bring good reader interactions and conversations. If not — they can always be turned back off.

Want to give JustComments a try? Scroll down to see it in action 👇

unsplash-logoJason Rosewell