Gaohaoyang / gaohaoyang.github.io

blog & blog theme🤘
http://gaohaoyang.github.io
MIT License
1.88k stars 2k forks source link

能否添加来必力LiveRe评论 #123

Closed troycizion123 closed 5 years ago

troycizion123 commented 5 years ago

能否添加来必力LiveRe评论?

TangMingliang95 commented 5 years ago

我 17 年 4 月试用过 LiveRe,但是当时它不是很好用,如果你想添加可以参考我当时添加的代码

  1. _config.yml 中添加 livere_shortname: your_short_name
# comments
# two ways to comment, only choose one, and use your own short name
# 两种评论插件,选一个就好了,使用自己的 short_name
disqus_shortname: 
livere_shortname: your_short_name
  1. _includes/comments.html 最底部添加这段代码,可能这段代码有更新,你应该替换成官方提供的最新版本,并添加 site.livere_shortname 相关代码。
{% if site.livere_shortname %}
<!-- 来必力City版安装代码 -->
<div id="lv-container" data-id="city" data-uid="{{site.livere_shortname}}">
<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版安装代码已完成 -->
{% endif %} 
troycizion123 commented 5 years ago

感谢!