为你的Hexo博客开启Valine评论

  • 注册Leancloud
  • 添加Class

踩坑

界面无法显示评论框并向你抛了一个异常

> TypeError: Cannot read property 'hide' of undefined
> at r.ErrorHandler (Valine.min.js:12)
> at r.init (Valine.min.js:12)
> at new r (Valine.min.js:12)
> at new i (Valine.min.js:12)
> at (index):1891
>

需要修改themes/next/_config.yml
valine.language修改为zh-cn
完整配置如下:

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: ***
appkey: ***
notify: false # mail notifier, See: https://github.com/xCss/Valine/wiki
verify: false # Verification code
placeholder: Just go go # comment box placeholder
avatar: mm # gravatar style
guest_info: nick,mail,link # custom comment header
pageSize: 10 # pagination size
language: zh-cn # language, available values: en, zh-cn
visitor: false