上一篇文章《hexo yilia 文章浏览量统计》,已经介绍了如何配置统计一个博客的访问量,那么如何配置评论系统呢?
常用的有以下几种评论系统:
0x01 畅言
- 前往 畅言官网 注册,注册成功后,按照官网提示,填好东西后,注意填写备案信息
- 登录畅言后台,获取自己的appid跟appkey
- 修改hexo\themes\yilia下的_config.yml,把你上述得到的appid跟appkey填写到如下位置:123456789widgets:- popular_posts#2、网易云跟帖wangyiyun: false#3、畅言changyan_appid: ''changyan_conf: ''
这样畅言就算配置完成了,重新编译,启动,就可以看到如下:
因为我没有备案号,所以看到是试用版
0x02 配置友言
- 前往 友言官网 注册,注册成功后,获取友言代码
- 在hexo\themes\yilia\layout_partial\post\下新建一个uyan.ejs的文件,将上述代码copy到该文件中
- 修改hexo\themes\yilia\layout_partial\article.ejs,找到1<% if (!index && post.comments){ %>
在此下方添加下列代码1<% if (theme.uyan){ %><%- partial('post/uyan', {key: post.slug,title: post.title,url: config.url+url_for(post.path)}) %><% } %>
如下:
- 获取你的id
- 修改hexo\themes\yilia下的_config.yml,在空白处,添加如下配置:1uyan: ''
这样友言已经配置好了,具体效果如下: