psicmi.party psicmi.party
首页
repositories
设计稿
  • front matter配置
  • 关于本站
  • 分类
  • 标签
  • 归档
GitHub (opens new window)

psicmi.party

首页
repositories
设计稿
  • front matter配置
  • 关于本站
  • 分类
  • 标签
  • 归档
GitHub (opens new window)
  • 如何关闭评论功能

    • 方式一 : 删除评论插件
      • 方式二 : 文章关闭评论
      psicmi.party
      2023-06-20
      随笔
      目录

      如何关闭评论功能

      # 如何关闭评论功能

      # 方式一 : 删除评论插件

      在 vuepress 工程下, docs/.vuepress/config.ts 文件中,如果要彻底去除评论功能,可以将此配置删除

      
      [
        'vuepress-plugin-comment', // 评论
        {
          choosen: 'gitalk',
          options: {
            clientID: '???', //GitHub oauth app clientid
            clientSecret: '???', //GitHub oauth app clientSecret
            repo: '???', // GitHub 仓库
            owner: '???', // GitHub仓库所有者
            admin: ['???'], // 对仓库有写权限的人
            proxy: 'https://strong-caramel-969805.netlify.app/github_access_token', //这个很关键
            // distractionFreeMode: true,
            pagerDirection: 'last', // 'first'正序 | 'last'倒序
            id: '<%- (frontmatter.permalink || frontmatter.to.path).slice(-16) %>', //  页面的唯一标识,长度不能超过50
            title: '「评论」<%- frontmatter.title %>', // GitHub issue 的标题
            labels: ['Gitalk', 'Comment'], // GitHub issue 的标签
            body:
              '页面:<%- window.location.origin + (frontmatter.to.path || window.location.pathname) %>', // GitHub issue 的内容
          },
        },
      ],
      
      
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23

      # 方式二 : 文章关闭评论

      在 markdown 文件的头部 front matter 中,关闭评论功能,如:

      ---
      comment: false
      ---
      
      1
      2
      3
      编辑 (opens new window)
      上次更新: 2023/06/21, 17:43:26
      Theme by Vdoing | Copyright © 2019-2023 psicmi.party | MIT License
      • 跟随系统
      • 浅色模式
      • 深色模式
      • 阅读模式