本文最后更新于 2055 天前,如遇到任何问题欢迎在评论区留言呀!
概念讲解
刚用 Hexo 部署好的博客评论功能是没有开启的,为了开启它,我们需要一个评论系统(就是一个别人帮你保存评论的平台),在你博客下的评论内容将保存到他们的服务器中去,今后再打开自己的博客,从他们的服务器中拉去评论内容。
注册账号
评论系统有很多,比如Disqus、Livere等,可以选择一个自己喜欢的注册。这里以Livere(中文名:来必力)为例。
访问 Livere 官网,点击右上角的图标注册账号,再点击 install(安装),选择City即可,按照提示填入自己的网址名,网址的地址,网站类型,然后提交,得到如下的一串代码:
<!-- 来必力 City 版安装代码 -->
<div id="lv-container" data-id="city" data-uid="**********">
<script type="text/javascript">
(function(d, s) {
var j, e = d.getElementsByTagName(s)[0];
if (typeof LivereTower === 'function') { return; }
j = d.createElement(s);
j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
j.async = true;
e.parentNode.insertBefore(j, e);
})(document, 'script');
</script>
<noscript>为正常使用来必力评论功能请激活 JavaScript</noscript>
</div>
<!-- City 版安装代码已完成 -->
注意第二行data-uid后面的内容,马上有用。
修改配置文件
打开 NexT 的主题配置文件,找到
# Support for LiveRe comments system.
# You can get your uid from https://livere.com/insight/myCode (General web site)
#livere_uid: your uid
将刚刚data-uid后面内容替换your uid 的位置,去掉#。
大功告成!