← 返回文章列表

twikoo


date: 2024-08-16 11:37 categories:

  • vuepress tags:
  • vuepress技巧

给vuepress2添加twikoo评论插件

方法一

  1. 安装评论插件和twikoo

    pnpm add -D @vuepress/plugin-comment twikoo
    
  2. 配置twikoo 打开.vuepress/config.ts文件,引入import { commentPlugin } from '@vuepress/plugin-comment'

import { commentPlugin } from '@vuepress/plugin-comment'
export default defineUserConfig({

//省略配置

  plugins: [
 
    commentPlugin({
      provider: 'Twikoo', // Artalk | Giscus | Waline | Twikoo
      envId: "twikoo_sever_url"
      // 在这里放置你的twikoo服务器地址
      // ...
    }),
  ],

});

方法二(使用的vuepress-theme-hope)

打开.vuepress/theme.ts文件,找到plugins配置项,添加如下配置

plugins: {
    blog: true,
    // 启用之前需安装 @waline/client
    // 警告: 这是一个仅供演示的测试服务,在生产环境中请自行部署并使用自己的服务!
    comment: {
      provider: "Twikoo",
      envId: "twikoo_sever_url",// 在这里放置你的twikoo服务器地址
    },
}