使用giscus给博客添加评论
- 在github中安装giscus
- 选择一个公开的仓库作为评论存放的地方(可以选择一个新的仓库)
- 在仓库 => Settings => General => 勾选Discussions
- 在giscus官网中检测是否满足条件,并找到四个关键参数。



- 在主题中配置属性
config.ts
import { defineUserConfig } from 'vuepress'
import { plumeTheme } from 'vuepress-theme-plume'
export default defineUserConfig({
theme: plumeTheme({
plugins: {
comment: {
provider: 'Giscus', // "Artalk" | "Giscus" | "Twikoo" | "Waline"
comment: true,
repo: '复制的1',
repoId: '复制的2',
category: "复制的3",
categoryId: '复制的4',
mapping: 'pathname',
reactionsEnabled: true,
inputPosition: 'bottom',
}
}
})
})