Skip to content

Commit 987c3e3

Browse files
committed
首页不加载 Valine, v1.7
1 parent f1fee40 commit 987c3e3

File tree

3 files changed

+23
-29
lines changed

3 files changed

+23
-29
lines changed

layout/_partial/plugins/valine.ejs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
11
<% if (theme.valine.enable ){ %>
2+
<!-- Valine Comments -->
23
<div class="comments vcomment" id="comments"></div>
4+
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
5+
<script src="//unpkg.com/valine@latest/dist/Valine.min.js"></script>
6+
<!-- Valine Comments script -->
7+
<script>
8+
var GUEST_INFO = ['nick','mail','link'];
9+
var guest_info = '<%= theme.valine.guest_info %>'.split(',').filter(function(item){
10+
return GUEST_INFO.indexOf(item) > -1
11+
});
12+
new Valine({
13+
el: '#comments',
14+
notify: '<%= theme.valine.notify %>' == 'true',
15+
verify: '<%= theme.valine.verify %>' == 'true',
16+
appId: "<%= theme.valine.appId %>",
17+
appKey: "<%= theme.valine.appKey %>",
18+
avatar: "<%= theme.valine.avatar %>",
19+
placeholder: "<%= theme.valine.placeholder %>",
20+
guest_info: guest_info.length == 0 ? GUEST_INFO : guest_info,
21+
pageSize: "<%= theme.valine.pageSize %>"
22+
})
23+
</script>
24+
<!-- Valine Comments end -->
325
<% } %>
4-

layout/_partial/script.ejs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,3 @@ lazyScripts.push('//s95.cnzz.com/z_stat.php?id=<%-theme.cnzz %>&web_id=<%-theme.
2020
<% } %>
2121

2222
<%- partial('plugins/dynamic-title') %>
23-
24-
25-
<!-- Valine Comments -->
26-
<% if (theme.valine.enable){ %>
27-
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
28-
<script src="//unpkg.com/valine@latest/dist/Valine.min.js"></script>
29-
<script type="text/javascript">
30-
var notify = '<%= theme.valine.notify %>' == true ? true : false;
31-
var verify = '<%= theme.valine.verify %>' == true ? true : false;
32-
var GUEST_INFO = ['nick','mail','link'];
33-
var guest_info = '<%= theme.valine.guest_info %>'.split(',').filter(function(item){
34-
return GUEST_INFO.indexOf(item) > -1
35-
});
36-
guest_info = guest_info.length == 0 ? GUEST_INFO :guest_info;
37-
new Valine({
38-
el: '.vcomment',
39-
notify: notify,
40-
verify: verify,
41-
appId: "<%= theme.valine.appId %>",
42-
appKey: "<%= theme.valine.appKey %>",
43-
avatar:"<%= theme.valine.avatar %>",
44-
placeholder: "<%= theme.valine.placeholder %>",
45-
guest_info:guest_info,
46-
pageSize:"<%= theme.valine.pageSize %>"
47-
})
48-
</script>
49-
<% } %>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hexo-theme-material-indigo",
3-
"version": "1.6.17",
3+
"version": "1.7.0",
44
"description": "Material Design theme for Hexo.",
55
"keywords": [
66
"hexo",

0 commit comments

Comments
 (0)