Blog Comments are back
By Anatoly Mironov
I haven’t had comments on my blog since I moved from wordpress. Until now. I just added comments back to my blog and here is how I did it.
The most convinient way is integrating my blog with Github Discussions using giscus.
The giscuss.app page walks you through the setup and authorization process.
I created a new public repository on Github, then I enabled Discussions feature on the repository (Settings -> Features).
My blog is a static site that uses Hugo and Ananke theme. Unfortunately it only supports Comento and Disqus. It would be better to have a more generic comment partial, which I might try to help with in the future. But for now I just wanted to make a quick win. Instead of overriding layouts/_default/single.html
(which would mean more work if I update Ananke theme from their repo in the future), I just re-used layouts/partials/comento.html
. I won’t need comento, so it’s fine for now.
I created layouts/partials/comento.html
and pasted the html code giscuss.app populated for me.
I also updated the config.toml
file with
[params]
comentoEnable=true
I first chose preferred_color_scheme
theming in giscuss, but then I realised by blog does not have any dark theme, which makes it worse when the comment section has dark theme (my preferred theme in the operating system) but the parent site is in light theme, so I changed the data-theme to light
for now.
I first read about this comment approach in Elio Stuyf’s blog post.
It’s beatiful, isn’t it?