VuePress 生态系统VuePress 生态系统
  • 主题指南
  • 默认主题
  • Hope 主题
  • Plume 主题
  • Reco 主题
  • 功能插件
  • Markdown 插件
  • 搜索插件
  • 博客插件
  • 渐进式应用插件
  • 统计分析插件
  • 搜索引擎优化插件
  • 开发插件
  • 工具插件
  • AI 插件
  • @vuepress/helper
  • English
  • 简体中文
GitHub
  • 主题指南
  • 默认主题
  • Hope 主题
  • Plume 主题
  • Reco 主题
  • 功能插件
  • Markdown 插件
  • 搜索插件
  • 博客插件
  • 渐进式应用插件
  • 统计分析插件
  • 搜索引擎优化插件
  • 开发插件
  • 工具插件
  • AI 插件
  • @vuepress/helper
  • English
  • 简体中文
GitHub
  • 博客
    • 指南
    • 配置
  • 评论
    • 指南
    • Giscus
    • Waline
    • Artalk
    • Twikoo
  • Feed
    • 指南
    • 插件配置
    • Frontmatter 配置
    • 频道设置
    • Feed 获取器

Giscus 选项

配置

repo

  • 类型: string
  • 详情:存放评论的仓库

repoId

  • 类型: string
  • 详情:仓库 ID,请从 Giscus 页面 生成。

category

  • 类型: string
  • 详情:讨论分类

categoryId

  • 类型: string
  • 详情:讨论分类 ID,请从 Giscus 页面 生成。

mapping

  • 类型: string
  • 默认值: "pathname"
  • 详情:页面 ↔️ discussion 映射关系,详见 Giscus 页面。

strict

  • 类型: boolean
  • 默认值: true
  • 详情:是否启用严格匹配

lazyLoading

  • 类型: boolean
  • 默认值: true
  • 详情:是否启用懒加载

reactionsEnabled

  • 类型: boolean
  • 默认值: true
  • 详情:是否启用主帖子上的反应

inputPosition

  • 类型: "top" | "bottom"
  • 默认值: "top"
  • 详情:输入框的位置

lightTheme

  • 类型: GiscusTheme

    type GiscusTheme =
      | 'dark_dimmed'
      | 'dark_high_contrast'
      | 'dark_protanopia'
      | 'dark'
      | 'light_high_contrast'
      | 'light_protanopia'
      | 'light'
      | 'preferred_color_scheme'
      | 'transparent_dark'
      | `https://${string}`
  • 默认值: "light"

  • 详情:

    Giscus 在日间模式下使用的主题

    应为一个内置主题关键词或者一个 CSS 链接。

darkTheme

  • 类型: GiscusTheme

    type GiscusTheme =
      | 'dark_dimmed'
      | 'dark_high_contrast'
      | 'dark_protanopia'
      | 'dark'
      | 'light_high_contrast'
      | 'light_protanopia'
      | 'light'
      | 'preferred_color_scheme'
      | 'transparent_dark'
      | `https://${string}`
  • 默认值: "dark"

  • 详情:

    Giscus 在夜间模式下使用的主题

    应为一个内置主题关键词或者一个 CSS 链接。

插件配置

你可以直接在插件选项中配置可序列化的选项:

.vuepress/config.ts
import { commentPlugin } from '@vuepress/plugin-comment'

export default {
  plugins: [
    commentPlugin({
      provider: 'Giscus',
      // 其他选项
      // ...
    }),
  ],
}

客户端配置

你可以使用 defineGiscusConfig 函数来配置 Giscus。

.vuepress/client.ts
import { defineGiscusConfig } from '@vuepress/plugin-comment/client'
import { defineClientConfig } from 'vuepress/client'

defineGiscusConfig({
  // Giscus 选项
})
在 GitHub 上编辑此页
上次更新: 2025/4/12 19:03
贡献者: Mister-Hope, meteorlxy, pengzhanbo