利用个人hexo+yilia+github搭建博客后,博客的根目录为: hexo,使用友盟统计访问人数后,使用什么工具,能方便访问的人留言?评论?本文主要分享hexo支持友言:
工具/原料
1
hexo
2
友言
3
win7
4
github
方法/步骤
3
修改hexo\themes\yilia\layout_partial\article.ejs,找到<% if (!index && post.comments){ %>在此下方添加下列代码<% if (theme.uyan){ %><%- partial('post/uyan', {key: post.slug,title: post.title,url: config.url+url_for(post.path)}) %><% } %>
4
获取你的id
5
修改hexo\themes\yilia下的_config.yml,在空白处,添加如下配置:uyan: '你的友言id'这样友言已经配置好了,重新编译,运行:hexo cleanhexo ghexo s访问: http://localhost:4000,可以看到如下:
注意事项
1
博客的根目录为: hexo
2
从友言官网获取到的代码,记得保存到 hexo\themes\yilia\layout_partial\post\
3
修改的是这个 hexo\themes\yilia\layout_partial\article.ejs 文件