hexo-theme-raytaylorism icon indicating copy to clipboard operation
hexo-theme-raytaylorism copied to clipboard

能否添加LiveRe(来必力)评论?

Open troycizion123 opened this issue 6 years ago • 1 comments

troycizion123 avatar May 02 '18 01:05 troycizion123

在themes/raytaylorism/layout/_partial/plugin/comment.ejs中底部,最后一行换成:

<% } else if (theme.lbl_product_key && page.comments){ %>
    <!-- 来必力City版安装代码 -->
    <div id="lv-container" data-id="city" data-uid="<%= theme.lbl_product_key %>" style="color: #D60036;text-align: center">
        <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版安装代码已完成 -->
<% } %>

然后在themes/raytaylorism/_config.yml中添加 lbl_product_key: '来必力上生成的key' 确保所有留言中lbl配置key,其他留空

ibrucekong avatar Jul 18 '18 02:07 ibrucekong