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

hipaper加入valine评论功能

Open arginsen opened this issue 5 years ago • 1 comments

  1. hipaper/_config.yml
valine:
  enable: true 
  appid:   # your leancloud application appid
  appkey:  # your leancloud application appkey
  notify: false
  verify: false
  placeholder: 写下你的评论吧~
  avatar: retro 
  guest_info: nick,mail,link 
  pageSize: 10 
  language: 
  visitor: true 
  comment_count: true 
  1. hipaper/layout/_partial/article.ejs
      <% if (!index && post.comments && (theme.valine.enable || theme.duoshuo_shortname || theme.disqus_shortname || theme.uyan_uid || theme.wumii || theme.livere_shortname)){ %>
      <%- partial('comment') %>
      <% } %>
  1. hipaper/layout/_partial/comment.ejs ,多说往后推一个,将第一个写成valine:
<% if (theme.valine.appid && theme.valine.appkey) {%>
    <script src='//unpkg.com/valine/dist/Valine.min.js'></script>
    <div id="vcomments"></div>
    <script>
        var notify = '<%= theme.valine.notify %>' == true ? true : false;
        var verify = '<%= theme.valine.verify %>' == true ? true : false;
        window.onload = function() {
            new Valine({
                el: '#vcomments',
                notify: notify,
                verify: verify,
                app_id: "<%= theme.valine.appid %>",
                app_key: "<%= theme.valine.appkey %>",
                placeholder: "<%= theme.valine.placeholder %>",
                avatar:"<%= theme.valine.avatar %>"
            });
        }
    </script>
<% } else if (theme.duoshuo_shortname){ %>
...

arginsen avatar May 07 '20 13:05 arginsen

您好,按照上述添加为什么没有显示评论?

hi-nikola avatar Jul 07 '22 09:07 hi-nikola