Configuring Giscus in Hugo

Words: 267

While setting up a comment section for my blog, I ran into a few issues and jotted some of them down.

Why Giscus

The Stack theme uses Disqus as its default comment system, but Disqus is a foreign service and requires payment, so I didn’t use it.

The theme also supports other common comment configurations. I first picked Gitalk, which I’d noticed frequently before — using Github Issues as a comment section was quite an eye-catching approach at the time.

However, I ran into some permission problems during configuration and found Gitalk’s permissions somewhat unreasonable: commenters have to authorize their accounts to the blogger in order to comment, and in theory the blogger then gains some permissions over the logged-in user that they shouldn’t have. On top of that, because of cross-origin issues, you also need to find a proxy to handle CORS, which adds further privacy concerns and configuration overhead.

In the end I chose Giscus. It uses its own App as the permission holder, and as a third party, users only need to authorize that app to complete the Github authorization.

It’s also more convenient and flexible to use.

Configuration Steps

  1. Install Giscus in Github
  2. Authorize the repository to the app
    1. Find Giscus in Applications
    2. Under Repository access, select the repository where comments are stored
  3. Go to the Giscus website to finish the configuration
    1. Choose a 语言
    2. Enter the authorized repository under 仓库, e.g. BoilTask/BoilTask.github.io
    3. Choose the configuration you want based on the descriptions that follow
  4. Check the required configuration under the 启用 giscus section

Just fill in the generated configuration wherever you need it.

This post is licensed under CC BY-NC-SA 4.0. If it helped, or if you have anything to say, the comment box below is open.
Page views —
Unique visitors —

Loading...