您的位置首页百科问答

hexo yilia 添加友言评论支持

hexo yilia 添加友言评论支持

的有关信息介绍如下:

hexo yilia 添加友言评论支持

利用个人hexo+yilia+github搭建博客后,博客的根目录为: hexo,使用友盟统计访问人数后,使用什么工具,能方便访问的人留言?评论?本文主要分享hexo支持友言:

前往友言官网:百度一下 友言 注册,注册成功后,获取友言代码

在hexo\themes\yilia\layout_partial\post\下新建一个uyan.ejs的文件,将上述代码copy到该文件中:

修改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)}) %><% } %>

获取你的id

修改hexo\themes\yilia下的_config.yml,在空白处,添加如下配置:

uyan: '你的友言id'

这样友言已经配置好了,重新编译,运行:

hexo clean

hexo g

hexo s

访问: http://localhost:4000,可以看到如下: