Comments
Let readers respond with giscus or Disqus.
Comments appear at the bottom of posts and standalone pages. They are not shown on lists or documentation pages. Pick one system; if you turn on both, both are shown.
giscus
giscus stores comments in the Discussions tab of a public GitHub repository. It is free, has no ads, and readers sign in with GitHub.
- Create a public GitHub repository, or use an existing one, and turn on Discussions in its settings.
- Install the giscus app on that repository.
- Go to giscus.app, enter the repository and pick a discussion category. Copy the values it generates.
- Paste them into
params.toml:
[giscus]
enable = true
repo = "your-name/your-repo"
repoId = "R_kgDO..."
category = "Announcements"
categoryId = "DIC_kwDO..."
Optional settings
| Setting | Default | What it does |
|---|---|---|
mapping |
pathname |
How a page is matched to a discussion. |
strict |
0 |
1 only matches discussions with the exact title. |
reactionsEnabled |
1 |
0 hides emoji reactions on the post. |
emitMetadata |
0 |
1 sends discussion data to the page, for advanced use. |
inputPosition |
top |
bottom puts the comment box under the comments. |
theme |
light |
Color theme. preferred_color_scheme follows the visitor’s system setting. |
lang |
en |
Language of the comment widget, such as pt or id. |
lazyLoading |
off | true loads comments only when the reader scrolls down to them. |
Disqus
Create a site at disqus.com and copy its shortname. Then add it to hugo.toml:
[services.disqus]
shortname = "your-shortname"
Disqus does not load on localhost. You will see a short notice there instead, and the real comments once the site is deployed.
Moving from an older version?
Earlier versions read
disqusShortname from params.toml, which never actually displayed comments. Use [services.disqus] as shown above.