Skip to content
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
14 changes: 14 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,20 @@ gitment: false
# client_id:
# client_secret:

# Valine Comment system. https://valine.js.org
valine:
enable: false # 如果你想使用valine,请将值设置为 true
appId: # your leancloud appId
appKey: # your leancloud appKey
notify: false # Mail notify
verify: false # Verify code
avatar: mm # Gravatar style : mm/identicon/monsterid/wavatar/retro/hide
placeholder: Just go go # Comment Box placeholder
guest_info: nick,mail,link # Comment header info
pageSize: 10 # comment list page size



# 规范网址
# 让搜索引擎重定向你的不同域名、不同子域、同域不同目录的站点到你期望的路径
# https://support.google.com/webmasters/answer/139066
Expand Down
4 changes: 4 additions & 0 deletions layout/_partial/plugins/valine.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<% if (theme.valine.enable ){ %>
<div class="comments vcomment" id="comments"></div>
<% } %>

2 changes: 2 additions & 0 deletions layout/_partial/post/comment.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
<%- partial('../plugins/uyan') %>

<%- partial('../plugins/gitment') %>

<%- partial('../plugins/valine') %>
<%} %>
27 changes: 27 additions & 0 deletions layout/_partial/script.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,30 @@ lazyScripts.push('//s95.cnzz.com/z_stat.php?id=<%-theme.cnzz %>&web_id=<%-theme.
<% } %>

<%- partial('plugins/dynamic-title') %>


<!-- Valine Comments -->
<% if (theme.valine.enable){ %>
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src="//unpkg.com/valine@latest/dist/Valine.min.js"></script>
<script type="text/javascript">
var notify = '<%= theme.valine.notify %>' == true ? true : false;
var verify = '<%= theme.valine.verify %>' == true ? true : false;
var GUEST_INFO = ['nick','mail','link'];
var guest_info = '<%= theme.valine.guest_info %>'.split(',').filter(function(item){
return GUEST_INFO.indexOf(item) > -1
});
guest_info = guest_info.length == 0 ? GUEST_INFO :guest_info;
new Valine({
el: '.vcomment',
notify: notify,
verify: verify,
appId: "<%= theme.valine.appId %>",
appKey: "<%= theme.valine.appKey %>",
avatar:"<%= theme.valine.avatar %>",
placeholder: "<%= theme.valine.placeholder %>",
guest_info:guest_info,
pageSize:"<%= theme.valine.pageSize %>"
})
</script>
<% } %>