Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hipaper加入valine评论功能 #46

Open
arginsen opened this issue May 7, 2020 · 1 comment
Open

hipaper加入valine评论功能 #46

arginsen opened this issue May 7, 2020 · 1 comment

Comments

@arginsen
Copy link

arginsen commented May 7, 2020

  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){ %>
...
@hi-nikola
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants