Adding Comments to this Blog with utterances
This blog has been running for a while now and one thing that was always missing was a way for people to leave comments. I never received any feedback/messages regarding my posts here, but I know for a fact that at least some traffic is generated by this website. So might as well give you, my dear listener (reader?) the chance to shout something back.
I wanted something lightweight. No tracking, no ads, no selling your data to a third party. Disqus is the go-to for a lot of static sites but it’s a bit of a bloat monster and the free tier shoves ads in your face. That’s a immediate disqualification.
Enter utterances. It’s a tiny comment widget that uses GitHub issues as a backend. Someone leaves a comment on your post, utterances creates a GitHub issue in a repository you specify and stores the comment there. The whole thing is FOSS, and requires no server-side code whatsoever. The only requirement is that commenters need a GitHub account to post, which honestly suits this blogs audience (do I have a audience? Are you real?) and might protect me from spam fingers crossed.
Setting it up was absolutely painless. I already use the hello-friend-ng Hugo theme which has built-in utterances support. All I had to do was create a dedicated public GitHub repository to hold the comments, install the utterances app on that repository, and drop a few lines into config.toml:
[params.utterances]
repository = "Schmiggolas/website-comments"
label = "Comment"
issueTerm = "pathname"
theme = "github-dark"
That’s it. The issueTerm = "pathname" part tells utterances to map each post to an issue based on its URL path, which keeps things organized. The github-dark theme matches the rest of the site nicely.
If your theme doesn’t have native utterances support you can still add it manually by embedding the script tag they provide into your post layout template. It’s literally a single <script> tag.
So if you’ve got something to say, now you can say it right below this post. Be nice, pretty please?
Thanks for reading 📢