maupassant 主题支持valine系统。至于valine怎么申请就不详说了。大致申请appid,appkey,设置中添加安全域名。
然后在主题的配置文件中开启即可。
然而打开后发现评论无法提交。经过研究,发现是一个链接网址有错误。更新就可。
comments.pug文件
if theme.valine.enable == true
#vcomment
script(src='//cdn1.lncld.net/static/js/3.0.4/av-min.js')
script(src='//cdn.jsdelivr.net/gh/xcss/valine@v1.1.7/dist/Valine.min.js')
script.
var notify = '#{ theme.valine.notify }' == true ? true : false;
var verify = '#{ theme.valine.verify }' == true ? true : false;
var GUEST_INFO = ['nick','mail','link'];
var guest_info = '#{ theme.valine.guest_info }'.split(',').filter(function(item){
return GUEST_INFO.indexOf(item) > -1
});
guest_info = guest_info.length == 0 ? GUEST_INFO :guest_info;
window.valine = new Valine({
el:'#vcomment',
notify:notify,
verify:verify,
appId:'#{theme.valine.appid}',
appKey:'#{theme.valine.appkey}',
placeholder:'#{theme.valine.placeholder}',
avatar:'#{theme.valine.avatar}',
guest_info:guest_info,
pageSize:'#{theme.valine.pageSize}'
})