-
Notifications
You must be signed in to change notification settings - Fork 273
/
layout.ejs
executable file
路96 lines (96 loc) 路 4.35 KB
/
layout.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
89
90
91
92
93
94
95
96
<!DOCTYPE html>
<html lang="<%- config.language %>">
<%- partial('_partial/base-head') %>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"></script>
<script type="text/javascript">
if (typeof window.$ == undefined) {
console.warn('jquery load from jsdelivr failed, will load local script')
document.write('<script src="<%- url_for('lib/jquery.min.js') %>" />')
}
</script>
<% if (is_home()) { %>
<body class="home-body">
<% } else if(is_post()){ %>
<body class="post-body">
<% } else if(page.layout === "404") { %>
<body class="four-zero-four-body">
<% } else if(page.layout === "about") { %>
<body class="about-body">
<% } %>
<!-- header -->
<%- partial('_partial/base-header') %>
<!-- fixed footer -->
<%- partial('_partial/base-footer-fixed') %>
<!-- wrapper -->
<div class="wrapper">
<%- partial('_partial/base-background-image') %>
<%- partial('_partial/script/font-loader') %>
<img class="loading" src="<%- url_for('assets/loading.svg') %>" style="display: block; margin: 6rem auto 0 auto; width: 6rem; height: 6rem;" />
<div class="container container-unloaded">
<%- body %>
<!-- profile -->
<% if (is_home()) { %>
<%- partial('_partial/base-profile') %>
<% } %>
</div>
<%- partial('_partial/base-footer', {}, {cache: true}) %>
</div>
<!-- toc -->
<% if(is_post() && (page.toc || (theme.toc && page.toc !== false))) { %>
<div class="toc-wrapper toc-wrapper-loding" style=<%- partial('_partial/intro-height', {attr: 'top'}) %>>
<div class="toc-catalog">
<span class="iconfont-archer catalog-icon"></span><span>CATALOG</span>
</div>
<%- toc(page.content, {class: 'toc', list_number: true}) %>
</div>
<% } %>
<!-- sidebar -->
<%- partial('_partial/sidebar/base-sidebar', {}, {cache: true}) %>
<!-- site-meta -->
<%- partial('./site-meta.ejs') %>
<!-- import experimental options here -->
<%- partial('_partial/custom-font', {}, {cache: true}) %>
<!-- main func -->
<script src="<%- url_for('scripts/main.js') %>?v=<%- theme.source_version %>"></script>
<!-- dark mode -->
<script src="<%- url_for('scripts/dark.js') %>?v=<%- theme.source_version %>"></script>
<!-- fancybox -->
<script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js" defer></script>
<!-- algolia -->
<% if (theme.algolia_search.enable) { %>
<%- partial('_partial/algolia') %>
<script src="<%- url_for('scripts/search.js') %>?v=<%- theme.source_version %>" defer></script>
<% } %>
<!-- busuanzi -->
<% if (theme.busuanzi) { %>
<script src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" async></script>
<% } %>
<!-- CNZZ -->
<% if (theme.CNZZ_analytics) { %>
<div style="display: none">
<script>
var cnzz_s_tag = document.createElement('script');
cnzz_s_tag.type = 'text/javascript';
cnzz_s_tag.async = true;
cnzz_s_tag.charset = 'utf-8';
cnzz_s_tag.src = 'https://w.cnzz.com/c.php?id=<%- theme.CNZZ_analytics %>&async=1';
var root_s = document.getElementsByTagName('script')[0];
root_s.parentNode.insertBefore(cnzz_s_tag, root_s);
</script>
</div>
<% } %>
<!-- async load share.js -->
<% if (is_post()) { %>
<script src="<%- url_for('scripts/share.js') %>?v=<%- theme.source_version %>" async></script>
<% } %>
<!-- mermaid -->
<% if (is_post() && theme.mermaid.enable) { %>
<script src='https://cdn.jsdelivr.net/npm/mermaid@<%= theme.mermaid.version %>/dist/mermaid.min.js'></script>
<script>
if (window.mermaid) {
mermaid.initialize({theme: '<%= theme.mermaid.theme %>'});
}
</script>
<% } %>
</body>
</html>