Skip to content

Commit

Permalink
Merge pull request #56 from ZvonimirSun/master
Browse files Browse the repository at this point in the history
Add Valine Comment
  • Loading branch information
iTimeTraveler authored Jul 13, 2018
2 parents 66dffba + da58bad commit f52c2eb
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
9 changes: 9 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ gitment:
repo: #The repo to store comments
client_id: #Your client ID
client_secret: #Your client secret
valine:
appid: #Leancloud应用app_id,必填
appkey: #Leancloud应用app_key,必填
notify: false
verify: false
placeholder: ヾノ≧∀≦)o快来评论一下吧!
avatar:
pageSize: 10
visitor: true

# Code Highlight theme
# Available value:
Expand Down
20 changes: 20 additions & 0 deletions layout/_partial/comment.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,24 @@
<!-- Gitment 自定义样式表 -->
<%- css('css/comment-gitment.css') %>
<!-- Gitment END! -->
<% } else if (theme.valine.app_id && theme.valine.app_key) {%>
<script src="//cdn.jsdelivr.net/npm/leancloud-storage@latest/dist/av-min.js"></script>
<script src='//cdn.jsdelivr.net/npm/valine@latest/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;
var visitor = <%= theme.valine.visitor %> == true ? true : false;
new Valine({
el: '#vcomments',
notify: notify,
verify: verify,
appId: '<%= theme.valine.appid %>',
appKey: '<%= theme.valine.appkey %>',
placeholder: '<%= theme.valine.placeholder %>',
avatar: '<%= theme.valine.avatar %>',
pageSize: <%= theme.valine.pageSize %>,
visitor: visitor
});
</script>
<% } %>

0 comments on commit f52c2eb

Please sign in to comment.