indigo现有两个主题分支,本博客用的是card分支
默认hexo-theme-indigo-card的1.6.14版是没有内置来必力评论的。网上也搜不到相关教程,只好自己增加了。
在themeshexo-theme-indigo-cardlayout_partialpost
目录里,修改comment.ejs
文件
添加以下句
<%- partial('../plugins/livere') %>
在themeshexo-theme-indigo-cardlayout_partialplugins
目录里,新建livere.ejs
文件,内容如下
<% if (theme.livere_uid){ %> <section class="comments" id="comments"> <div id="lv-container" data-id="city" data-uid="你的来必力ID"> <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> <% } %>
在主题配置文件themeshexo-theme-indigo-card_config.yml
里,搜索uyan_uid
,在其下一行添加
livere_uid: 你的来必力ID
注意:上述两个文件请替换为注册时给的“来必力ID”。
保存所有修改的文件,完成。