Hugo Utterances Module

This module add support for Utterances comments engine, a lightweight comments widget built on GitHub issues.

GitHub Stars Used By Used By Used By Used By


  • Flexible and Configurable.
  • JS APIs: change theme on the fly, it’s usually used in the case of color(dark/light) changed.


Requires extended Hugo and Go.

Append the to the module.imports.

2path = ""

Site Parameters

endpointStringY client script endpoint.
repoStringY-The GitHub repository, user/repo.
mappingStringNpathnameThe mapping between blog posts and GitHub issues. Available options: pathname, url, title, og:title.
themeStringNpreferred-color-schemeAvailable options: github-light, github-dark, github-dark-orange, icy-dark, dark-blue, photon-dark, preferred-color-scheme, boxy-light, gruvbox-dark.
labelStringNcommentsThe label that will be assigned to issues created by Utterances.

See the configuration for details.


See the example site and it’s source code.


Firstly, we’ll need to tweak the site parameters listed above.

Import Script

Then place the following partial to your template where you want the comments to appear.

1{{ partial "utterances/script" . }}

Or specify another options than .Site.Params.utterances, it’s used to specify multiple Utterances configurations.

The global options will be merged into the custom options.

1{{ partial "utterances/script-with-options" }}


You may want to change the Utterances theme on the fly, a common example is changing the Utterances to the corresponding theme when the user switches colors(dark/light).

1import Utterances from 'mods/utterances/js';
3const utterances = new Utterances();

You can find the real example on the example site.