优势:
✅ 基于GitHub Discussions
✅ 支持反应表情和回复
✅ 完全免费,无广告
✅ 支持多种主题
配置步骤:
设置GitHub仓库:
- 配置hugo.yaml:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
| params:
comments:
enabled: true
provider: giscus
giscus:
repo: username/repo-name
repoID: R_kgDOxxxxxx
category: General
categoryID: DIC_kwDOxxxxxx
mapping: pathname
lightTheme: light
darkTheme: dark
reactionsEnabled: 1
emitMetadata: 0
|
- 或根据stach-starter模板配置config/_default/params.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| ## Comments
[comments]
enabled = true
provider = "giscus"
[comments.giscus]
repo = "ynhugo/ynhugo.github.io"
repoID = "R_xxxxxxxx"
category = "Announcements"
categoryID = "DIC_xxxxxxxxx"
mapping = "pathname"
lightTheme = "light"
darkTheme = "dark"
reactionsEnabled = 1
emitMetadata = 0
|
获取配置信息:
- 访问 giscus.app
- 输入仓库信息,获取配置代码