2024-01-09 02:24:38 +08:00
|
|
|
|
---
|
|
|
|
|
title: 评论系统
|
2024-12-31 00:34:20 +00:00
|
|
|
|
linkTitle: 评论
|
2024-01-09 02:24:38 +08:00
|
|
|
|
---
|
|
|
|
|
|
2024-12-31 00:34:20 +00:00
|
|
|
|
Hextra 支持为您的网站添加评论系统。
|
|
|
|
|
目前支持 [giscus](https://giscus.app/)。
|
2024-01-09 02:24:38 +08:00
|
|
|
|
|
|
|
|
|
<!--more-->
|
|
|
|
|
|
|
|
|
|
## giscus
|
|
|
|
|
|
2024-12-31 00:34:20 +00:00
|
|
|
|
[giscus](https://giscus.app/) 是一个由 [GitHub Discussions](https://docs.github.com/en/discussions) 提供支持的评论系统。它是免费且开源的。
|
2024-01-09 02:24:38 +08:00
|
|
|
|
|
2024-12-31 00:34:20 +00:00
|
|
|
|
要启用 giscus,您需要在网站配置文件中添加以下内容:
|
2024-01-09 02:24:38 +08:00
|
|
|
|
|
|
|
|
|
```yaml {filename="hugo.yaml"}
|
|
|
|
|
params:
|
|
|
|
|
comments:
|
|
|
|
|
enable: false
|
|
|
|
|
type: giscus
|
|
|
|
|
|
|
|
|
|
giscus:
|
2024-12-31 00:34:20 +00:00
|
|
|
|
repo: <仓库>
|
|
|
|
|
repoId: <仓库 ID>
|
|
|
|
|
category: <分类>
|
|
|
|
|
categoryId: <分类 ID>
|
2024-01-09 02:24:38 +08:00
|
|
|
|
```
|
|
|
|
|
|
2024-12-31 00:34:20 +00:00
|
|
|
|
giscus 的配置可以从 [giscus.app](https://giscus.app/) 网站生成。更多详细信息也可以在那里找到。
|
2024-01-09 02:24:38 +08:00
|
|
|
|
|
2024-12-31 00:34:20 +00:00
|
|
|
|
可以在页面的 front matter 中为特定页面启用或禁用评论:
|
2024-01-09 02:24:38 +08:00
|
|
|
|
|
|
|
|
|
```yaml {filename="content/docs/about.md"}
|
|
|
|
|
---
|
2024-12-31 00:34:20 +00:00
|
|
|
|
title: 关于
|
2024-01-09 02:24:38 +08:00
|
|
|
|
comments: true
|
|
|
|
|
---
|
2024-12-31 00:34:20 +00:00
|
|
|
|
```
|