Skip to content

Commit

Permalink
首页不加载 Valine, v1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
yscoder committed Nov 19, 2017
1 parent f1fee40 commit 987c3e3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 29 deletions.
23 changes: 22 additions & 1 deletion layout/_partial/plugins/valine.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
<% if (theme.valine.enable ){ %>
<!-- Valine Comments -->
<div class="comments vcomment" id="comments"></div>
<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>
<!-- Valine Comments script -->
<script>
var GUEST_INFO = ['nick','mail','link'];
var guest_info = '<%= theme.valine.guest_info %>'.split(',').filter(function(item){
return GUEST_INFO.indexOf(item) > -1
});
new Valine({
el: '#comments',
notify: '<%= theme.valine.notify %>' == 'true',
verify: '<%= theme.valine.verify %>' == 'true',
appId: "<%= theme.valine.appId %>",
appKey: "<%= theme.valine.appKey %>",
avatar: "<%= theme.valine.avatar %>",
placeholder: "<%= theme.valine.placeholder %>",
guest_info: guest_info.length == 0 ? GUEST_INFO : guest_info,
pageSize: "<%= theme.valine.pageSize %>"
})
</script>
<!-- Valine Comments end -->
<% } %>

27 changes: 0 additions & 27 deletions layout/_partial/script.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,3 @@ 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>
<% } %>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hexo-theme-material-indigo",
"version": "1.6.17",
"version": "1.7.0",
"description": "Material Design theme for Hexo.",
"keywords": [
"hexo",
Expand Down

0 comments on commit 987c3e3

Please sign in to comment.