Giscus

2026-07-11 2 minutes hugo, plugins, comments

Summary

A comments system powered by GitHub Discussions. Allows people to leave comments and reactons on my Hugo site via GitHub.

How it works

Giscus uses the GitHub Discussions API to find the discussion associated with the page based on a chosen mapping (such as url, path, title). If a discussion cannot be found, an empty comment frame will be shown and a new discussion will be created should someone leave a comment or reaction.

Giscus

Table of Contents

Summary

A comments system powered by GitHub Discussions. Allows people to leave comments and reactons on my Hugo site via GitHub.

How it works

Giscus uses the GitHub Discussions API to find the discussion associated with the page based on a chosen mapping (such as url, path, title). If a discussion cannot be found, an empty comment frame will be shown and a new discussion will be created should someone leave a comment or reaction.

Using this means that users need a GitHub account and permit Giscus to submit on there behalf by using GitHub OAuth flow. Giscus requires a public repository to post to. If your site repository is private and don’t wish to make it public you can configure Giscus to manage discussions in a second repository.

Leveraging Github functionality

Users can create comments and reactions directly on GitHub so long as the discussion has been created. I can also moderate comments from GitHub. Because this is using native Github functionality, I have added a Github Action that notifies me when a comment has been left. The action filters out reactions, and comments made by me, and posts a task into my Todoist inbox as part of my GTD capture activity.

No changing paths

You need to be careful with renames in Hugo - it easy to lose the association to a discussion. A change to a blog post path will result in the association with a discussion to be lost (assuming there is an active discussion of course). You therefore need strict rules around path changes. The primary path for a blog post must remain intact as this will be the one picked up by Giscus. Whilst Aliases allow you to specify multiple paths for a blog page, the primary path will be used by Giscus. If a change in paths is required, then you can technically update the discussion in GitHub to fix up the match. Some checks around orphaned discussions would be beneficial (now in my Todoist inbox!).