hexo博客系列 添加评论系统-Valine

注册Leancloud

我们的评论系统其实是放在Leancloud上的,因此首先需要去注册一个账号

Leancloud官网,点我注册

注册完以后需要创建一个应用,名字可以随便起,然后 进入应用->设置->应用key

配置 hexo

拿到你的appid和appkey之后,打开主题配置文件 搜索 valine,填入appid 和 appkey

1
2
3
4
5
6
7
8
9
10
11
valine:
enable: true # When enable is set to be true, leancloud_visitors is recommended to be closed for the re-initialization problem within different leancloud adk version.
appid: xxx # your leancloud application appid
appkey: xxx # your leancloud application appkey
notify: false # mail notifier , https://github.com/xCss/Valine/wiki
verify: false # Verification code
placeholder: ヾノ≧∀≦)o来啊,快活啊! # comment box placeholder
avatar: mm # gravatar style
guest_info: nick,mail,link # custom comment header
pageSize: 10 # pagination size
visitor: false

最后!记得在Leancloud -> 设置 -> 安全中心 -> Web 安全域名 把你的域名加进去

刷新一下~ 是不是就能看到评论框了?