前言
Valine工具与上一篇提到的说说功能,后端用的是一套系统,所以Valine只关注前端怎么配置即可;Twikoo稍微复杂点,需要用netlify部署,Twikoo官网上也有相应的文档,后端配置就不多说了,主要也是介绍下前端的配置
正文
1、Valine工具配置
修改主题配置文件_config.butterfly.yml
comments:
# Up to two comments system, the first will be shown as default
# Choose: Disqus/Disqusjs/Livere/Gitalk/Valine/Utterances/Facebook Comments
use: Valine,Twikoo # 配置2个可以任意切换
text: true # Display the comment name next to the button
# lazyload: The comment system will be load when comment element enters the browser's viewport.
# If you set it to true, the comment count will be invalid
lazyload: false
count: false # Display comment count in top_img
# valine
# https://valine.js.org
valine:
appId: 填写leanCloudAPPID
appKey: 填写leanCloudAPPKEY
pageSize: 10 # comment list page size
avatar: monsterid # gravatar style https://valine.js.org/#/avatar
lang: zh-CN # i18n: zh-CN/zh-TW/en/ja
placeholder: 请留下你的脚印! # valine comment input placeholder (like: Please leave your footprints)
guest_info: nick,mail,link # valine comment header info (nick/mail/link)
recordIP: false # Record reviewer IP
serverURLs: 填写leanCloud API(也需要绑定域名) # This configuration is suitable for domestic custom domain name users, overseas version will be automatically detected (no need to manually fill in)
bg: # valine background
emojiCDN: # emoji CDN
enableQQ: true # enable the Nickname box to automatically get QQ Nickname and QQ Avatar
requiredFields: nick,mail # required fields (nick/mail)
option:
具体的博客页面 配置 comments:true,不需要评论的页面 改为false
---
title: 工具类开发之excel模板导出(带单选下拉框、多选下拉框、单选下拉级联)
comments: true
date: 2020-11-11 15:30:11
---
2、Twikoo工具配置
修改主题配置文件_config.butterfly.yml
# Twikoo 评论
# https://twikoo.js.org/backend.html#netlify-%E9%83%A8%E7%BD%B2
# https://app.netlify.com/
# https://cloud.mongodb.com/
twikoo:
envId: https://xxxxx/.netlify/functions/twikoo
region:
visitor: false
option:
最后
个人觉得这2个工具 各有优缺点吧,valine部署比较方便和说说是一个后台,但是没法很轻松的管理整个评论数据;twikoo加载速度稍微有点慢,但是页面上有管理入口,可以随时随地轻松管理评论,具体看你们怎么使用吧,我是2个都加上去了。