Skip to content

Comment

Rise edited this page Feb 23, 2023 · 8 revisions

Commenting

Supported commenting services:

  • Gitalk
  • Giscus
  • Disqus
  • LiveRe
  • Twikoo
  • Waline
  • Utterances

Configuration

Gitalk

Edit your config.toml in the hugo website's root directory.

enableGitalk = true
[params.gitalk]
  owner = "user"
  repo = "repo name"
  client_id = "your client id"
  client_secret = "your client secret"

Notice: Gitalk will not be shown in local preview.

Giscus

Edit your config.toml in the hugo website's root directory.

enableGiscus = true
[params.giscus]
    data_repo="username/repo"
    data-repo-id="**************************"    
    data_category="General"
    data_category_id="*********************"
    data_mapping="pathname"
    data_strict="0"
    data_reactions_enabled="1"
    data_emit_metadata="0"
    data_input_position="bottom"
    data_theme="preferred_color_scheme"
    data_lang="en"
    crossorigin="anonymous"

NOTE: The value of data_theme will be overridden to dark when applying dark theme via dark theme switch.

Thanks shinyzhu for Gisqus's integration.

Disqus

To integrate Disqus, please add a line to config.toml in the root directory:

disqusShortname = "Your disqus short name."

Thanks for nicholaskajoh and jenlky's feedback.

LiveRe!

Edit your config.toml in the hugo website's root directory.

Add the following line to the section [params]

livereId = "xxxx"

"xxxx" stands for the value of data-uid in your LiveRe HTML code.

Twikoo

Edit your config.toml in the hugo website's root directory.

Add the following line to the section [params]

enableTwikoo = true
twikooEnvId = "twikoo-YourEnvId"

Replace YourEnvId with your actual environment id.

If your Tencent Cloud Environment is deployed in Guangzhou server, don't forget to add this:

twikooRegion = "ap-guangzhou"

Waline

Edit your config.toml in the hugo website's root directory.

Add the following line to the section [params]

walineServer = "https://yourappaddress.vercel.app"

walineServer is corresponding to serverURL.

Utterances

Edit your config.toml in the hugo website's root directory.

Add the following line to the section [params]

enableUtterances = true

And add a new section named params.utterances, like this:

[params.utterances]
repo="your repo"
term="[ENTER TERM HERE]"
label="your label"
theme="github-light"

Other

To add other services, you can edit ./layouts/partials/comment.html and ./layouts/partials/head.html by yourself.

And you can also open an issue, reminding me to add a feature.


Disable commenting

Disable commenting for one post

If you want to disable the comment in a specific post, please add this line to the post's frontmatter:

comment : false

For details about frontmatter, pleaes visit here.

Disable globally

Just remove the configurations about commenting in config.toml.