iTimeTraveler / hexo-theme-hipaper

A fashional newspaper theme for Hexo.
https://itimetraveler.github.io/hexo-theme-hipaper/
MIT License
249 stars 77 forks source link

hipaper加入valine评论功能 #46

Open arginsen opened 4 years ago

arginsen commented 4 years ago
  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 
  2. 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') %>
      <% } %>
  3. 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){ %>
    ...
hi-nikola commented 1 year ago

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