Hexo主题indigo添加来必力评论

匿名 (未验证) 提交于 2019-12-03 00:14:01

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”。

保存所有修改的文件,完成。

原文:大专栏Hexo主题indigo添加来必力评论


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!