在搭建Hexo博客时候,很多免费的评论插件都找不到,发现一个来比力评论插件可以使用,分享给有缘看到此篇文章的童鞋。
A.来比力评论系统
众所周知,很多第三方系统都挂掉了,畅言还算不错,但是需要备案,比较麻烦。
相信很多人应该都是使用的来比力评论插件
废话不多说,直接上教程
步骤一:
themes_config.yml中添加
#### 6. 来比力 把代码管理中 data -uid中的内容复制到这里来livere_uid: "*********************"
步骤二:
在目录themes_partial中,在最后大括号内加入来必力的代码片段,插入位置要注意看清楚,很多小白都是在这里百思不得其解。
<% if (theme.gitment_owner && theme.gitment_repo &&theme.gitment_oauth && theme.gitment_oauth.client_id && theme.gitment_oauth.client_secret){ %><%- partial('post/gitment', { key: post.slug, title: post.title, url: config.url+url_for(post.path) }) %><% } %> <!-- 来必力City版安装代码 --> <% if (theme.livere_uid){ %> <!-- 这一句是适配样式 --> <section class="duoshuo" id="comments"> <!-- 以下是 来必力City版安装代码 --> <div id="lv-container" data-id="city" data-uid="MTAyMC8zNjg1My8xMzM4OQ=="> <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> </section><% } %>#小白注意,这里要看看要在这括号之前插入。<% } %>