【自搭博客系统篇六】:给博客添加评论功能,二选一 Valine,Twikoo

前言

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个都加上去了。

  • 6
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值