hexo-theme-hipaper
hexo-theme-hipaper copied to clipboard
hipaper加入valine评论功能
- 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
- 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') %>
<% } %>
- 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){ %>
...
您好,按照上述添加为什么没有显示评论?