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

Add Valine Comment #56

Merged
merged 1 commit into from
Jul 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
<% } %>