-
Notifications
You must be signed in to change notification settings - Fork 72
/
script.ejs
88 lines (75 loc) · 2.34 KB
/
script.ejs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<% if(theme.vendors.jquery_js){ %>
<%- js(theme.vendors.jquery_js) %>
<% }else{ %>
<%- js('lib/jquery/jquery.js')%>
<% } %>
<% if(theme.lazyload){ %>
<% if(theme.vendors.lazyload_js){ %>
<%- js(theme.vendors.lazyload_js) %>
<% }else{ %>
<%- js('lib/lazyload/lazyload.js')%>
<% }} %>
<% if(theme.fancybox){ %>
<% if(theme.vendors.fancybox_js){ %>
<%- js(theme.vendors.fancybox_js) %>
<% }else{ %>
<%- js('lib/fancybox/fancybox.js')%>
<% }} %>
<% if(theme.pjax){ %>
<% if(theme.vendors.pjax_js){ %>
<%- js(theme.vendors.pjax_js) %>
<% }else{ %>
<%- js('lib/pjax/pjax.js')%>
<% }} %>
<%- js(['js/utils', 'js/modules', 'js/zui', 'js/script']) %>
<% if(theme.leancloud.enable){ %>
<%- partial('_partial/common/visitors') %>
<% } %>
<% if(theme.daovoice.enable){ %>
<%- partial('_partial/common/daovoice') %>
<% } %>
<% if(theme.seo.baidu_auto_push) { %>
<script>
(function () {
var bp = document.createElement('script');
var curProtocol = window.location.protocol.split(':')[0];
if (curProtocol === 'https') {
bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
} else {
bp.src = 'http://push.zhanzhang.baidu.com/push.js';
}
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(bp, s);
})();
</script>
<% } %>
<script>
var _hmt = _hmt || [];
(function () {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?4c204d8bc027a0455b5fc642ac334ca8";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<% if(theme.analytics.baidu) { %>
<script defer src='https://hm.baidu.com/hm.js?<%- theme.analytics.baidu %>'></script>
<% } %>
<%- (theme.analytics.cnzz && js({ src: 'https://s9.cnzz.com/z_stat.php?id=' + theme.analytics.cnzz + '&web_id=' + theme.analytics.cnzz, defer: true })) %>
<% if(theme.analytics.tencent) { %>
<script>
var _mtac = {};
(function () {
var mta = document.createElement("script");
mta.src = "//pingjs.qq.com/h5/stats.js?v2.0.4";
mta.setAttribute("name", "MTAH5");
mta.setAttribute("sid", "<%- theme.analytics.tencent %>");
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(mta, s);
})();
</script>
<% } %>
<% if(theme.custom.foot) { %>
<%- theme.custom.foot %>
<% } %>
<%- (theme.custom.js && js({ src: theme.custom.js, defer: true })) %>