blinkfox / hexo-theme-matery

A beautiful hexo blog theme with material design and responsive design.一个基于材料设计和响应式设计而成的全面、美观的Hexo主题。国内访问:http://blinkfox.com
https://blinkfox.github.io/
Apache License 2.0
5.23k stars 1.25k forks source link

使用国际版LeanCloud作为Valine评论的后端的话需要添加自定义URL #537

Closed jeffreyouni closed 3 years ago

jeffreyouni commented 3 years ago

需要在layout/_partial/valine.ejs添加自定义URL的参数。

<script>
    new Valine({
        el: '#vcomments',
        appId: '<%- theme.valine.appId %>',
        appKey: '<%- theme.valine.appKey %>',
        notify: '<%- theme.valine.notify %>' === 'true',
        verify: '<%- theme.valine.verify %>' === 'true',
        visitor: '<%- theme.valine.visitor %>' === 'true',
        avatar: '<%- theme.valine.avatar %>',
        pageSize: '<%- theme.valine.pageSize %>',
        lang: '<% if (config.language == "zh-CN") {  %>zh-cn<% } else { %>en<% } %>',
        placeholder: '<%= theme.valine.placeholder %>'
        ,serverURLs: '<%= theme.valine.serverURLs %>' // 加上这一行
    });
</script>

然后在主题的_config.ymlvaline添加自定义URL。

valine:
  enable: false
  appId:
  appKey:
  notify: false
  verify: false
  visitor: true
  avatar: 'mm' # Gravatar style : mm/identicon/monsterid/wavatar/retro/hide
  pageSize: 10
  placeholder: 'just go go' # Comment Box placeholder
  background: /medias/comment_bg.png
  serverURLs: https://AppID前8位.api.lncldglobal.com # 加上这一行
No5972 commented 3 years ago

是使用了国际版LeanCloud的Valine。。。