为Gridea添加Valine评论系统
Valine
Valine(官网)是一款基于LeanCloud的快速、简洁且高效的无后端评论系统。
LeanCloud
Gridea配置
在主题模板文件head.ejs(以simple主题为例路径为/themes\simple\templates\_blocks
)中添加:<script src='//unpkg.com/valine/dist/Valine.min.js'></script>
在主题模板文件post.ejs(以simple主题为例路径为\themes\simple\template
)文末代码位置处添加:
<div id="vcomments"></div>
<script>
new Valine({
el: '#vcomments',
appId: '<API_ID>',
appKey: '<API_Key>'
})
</script>
停用原评论系统,将获取appId
和appKey
填入对应位置,配置完成。
错误信息
由于使用了LeanCloud国际版,配置完成后页面显示401
错误,须手动在LeanCloud应用
-存储
中添加一个class
:Comment
(参考)。