Comment System comment
The theme supports four comment systems: waline
, twikoo
, gitalk
, and giscus
. You can choose one according to your preference.
If you want to disable comments for articles individually, add comment: false
to the front-matter
of the article.
If you want to enable comments for pages individually, add comment: true
to the front-matter
of the page.
Global Switch
Configuration: comment.enable
Enable or disable comments.
Type | Possible Values | Default |
---|---|---|
Boolean | true | false | true |
Comment System Selection
Configuration: comment.system
Type | Possible Values | Default |
---|---|---|
String | waline | gitalk | twikoo | giscus | waline |
Waline Configuration
Configuration: comment.config.waline
Server
Please visit Waline Official Website #Quick Start (opens in a new tab) and follow the instructions to configure the Waline server.
The default domain vercel.app is blocked in mainland China, so it is recommended to bind a custom domain on Vercel. If you don't have a custom domain yet, you can email me or add me on WeChat do-not-go-plzzz
, and I can provide you with a spare domain for resolution.
Client
After obtaining the serverUrl
(the link to the Vercel application, which can be bound to a custom domain), fill it in _config.redefine.yml
.
comment:
config:
waline:
serverUrl: https://example.example.com #你拿到的 serverUrl
For more information about the Waline comment system, please visit the Waline Official Website (opens in a new tab).
Gitalk Configuration
For more information about the Gitalk comment system, please visit the Gitalk Official Website (opens in a new tab).
Configuration: comment.config.gitalk
Get GitHub OAuth App
Register or log in to GitHub (opens in a new tab), create a new OAuth App (opens in a new tab), and fill in the Homepage URL
and Authorization callback URL
with your own blog's domain.
After successfully creating the OAuth App, save the Client ID
and Client Secret
, which will be used below. Note that the Homepage URL
and Authorization Callback URL
should end with /
.
Create a GitHub Repository
Go back to GitHub (opens in a new tab), create a new repository (opens in a new tab) to store Gitalk comments, and open Issues. Manually add an Issue with any content.
Fill in the Configuration
Fill in your GitHub username
, repository name
, Client ID
of the OAuth App, and Client Secret
in the theme configuration file.
comment:
config:
gitalk:
clientID: 你的 Client ID
clientSecret: 你的 Client Secret
repo: 你的仓库名
owner: 你的 GitHub 用户名
Example:
comment:
config:
gitalk:
clientID: 1234567890abcdef1234
clientSecret: 1234567890abcdef1234567890abcdef12345678
repo: gitalk
owner: EvanNotFound
Result
Twikoo Configuration
For more information about the Twikoo commenting system, please visit the Twikoo official website (opens in a new tab).
Configuration item name: comment.config.twikoo
Server-side
Please visit the Twikoo official website #Quick Start (opens in a new tab) and follow the instructions to configure the Twikoo server-side. (It is recommended to use the Vercel deployment method)
Client-side
After obtaining the server_url
you need, fill it in the _config.redefine.yml
file.
Note that the region
field only needs to be filled in when using Tencent Cloud Functions, and can be left blank in other cases.
comment:
config:
twikoo:
server_url: https://example.example.com #你的 server_url
region: #你的 region(可选)
Giscus Configuration
For more information about the Giscus commenting system, please visit the Giscus official website (opens in a new tab).
Configuration item name: comment.config.giscus
Please configure it according to the instructions on the Giscus official website (opens in a new tab), and fill it in the theme configuration file.
Example configuration:
comment:
system: giscus
config:
...
giscus:
repo: Ching367436/ching367436.github.io # Github repository name
repo_id: R_kgDOJAMXOw # Github repository id
category: Announcements # Github discussion category
category_id: DIC_kwDOJNMYO84CVdDe # Github discussion category id
mapping: title
strict: 0
reactions_enabled: 1
emit_metadata: 0
lang: en
input_position: bottom
loading: not-lazy