Article comments
   2 min read

At first I did not intend to enable comments, but since humans are social animals, I went to see if I could set up a system without having to hack too much.
At first I considered Disq.us, which comes with Hugo, but it has many issues.
Zdoc has Utteranc.es pre-configured, and it has the advantages of being limited to GitHub users (all good people) and to be statically stored on a repo.

Setup

I made a public repo just for the comments and installed the Utteranc.es app on it.
All I had to do then was go to config/params.toml, enable the commenting section and set the credentials:

1
2
3
4
5
enableComment = true

[utterances]       # https://utteranc.es/
  owner = "<GitHub Username>"              # Your GitHub ID
  repo = "<utteranc.es repo name>"               # The repo to store comments

And Zdoc automatically adds a comments field at the end of any articles.

Blog

But on blogposts, it doesn’t. To enable that, I had to manually edit the partial, by adding {{ partial "comments/comments.html" . }} in the correct place:

1
2
3
4
5
6
7
8
9

<article id="list-main" class="{{ if $wideViewAsDefault }}lm{{ else }}m{{ end }}" data-dir="{{ $.Param "languagedir" | default "ltr" }}">
      {{ if $.Param "enableBlogBreadcrumb" }}
        {{ partial "main/component/breadcrumb.html" . }}
      {{ end }}
      {{ partial "main/sections/list-main.html" . }}
      {{ partial "main/component/pagination-single.html" . }}
      {{ partial "comments/comments.html" . }}
    </article>

And that’s it!.
Unfortunately, since it’s based on GitHub Issues and not on GitHub Discussions there’s no pre-moderation. So behave.

What's on this Page