博客vuepress添加评论功能
目前,vuepress-plugin-comment 支持在 Vuepress 中使用 Valine,自动管理 SPA路由 相关的工作。
记得安装插件valine,不然评论一直出不来,我前面是没按一直出不来。
安装插件
如果使用 npm:
npm install --save vuepress-plugin-comment
npm install --save valine
如果使用 yarn:
yarn add vuepress-plugin-comment -D
yarn add valine -D
注册leancloud
leancloudhttps://leancloud.cn/
创建应用
获取appId和appKey
快速使用
将 vuepress-plugin-comment 添加到vuepress项目的插件配置中:
module.exports = {
plugins: [
[
'vuepress-plugin-comment',
{
choosen: 'valine',
// options选项中的所有参数,会传给Valine的配置
options: {
el: '#valine-vuepress-comment',
appId: 'Your own appId',
appKey: 'Your own appKey'
}
}
]
]
}