-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
307 lines (285 loc) · 10.1 KB
/
index.html
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="./BioMetaLogo.png" />
<title>BioMeta</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="Description">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify@4/lib/themes/vue.css">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/gitalk/dist/gitalk.css">
<style>
.sidebar {
padding: 0 0 0 0;
}
.app-name {
border-bottom: 1px solid rgb(238, 238, 238);
}
</style>
<script>
var _hmt = _hmt || [];
(function () {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?5149f0a3f26bca92fd1fb82e2179958c";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-SRDVF8YR71"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-SRDVF8YR71');
</script>
</head>
<body>
<div id="app">Loading to BioMeta</div>
<script>
window.$docsify = {
repo: 'https://github.com/ParallelLight',
// loadNavbar: true,
loadSidebar: true,
subMaxLevel: 4,
auto2top: true,
homepage: '_homepage.md',
coverpage: true,
logo: './BioMetaLogo.svg',
name: 'BioMeta',
themeColor: 'rgb(126, 195, 141)',
autoHeader: true,
formatUpdated: '{YYYY}-{MM}-{DD}',
notFoundPage: true,
topMargin: 25,
search: {
maxAge: 86400000, // 过期时间,单位毫秒,默认一天
// paths: [], // or 'auto'
paths: 'auto',
// 支持本地化
placeholder: {
'/en/': '🔍 Type to search',
'/': '🔍 搜索'
},
// 支持本地化
noData: {
'/en/': 'No Results',
'/': '找不到结果'
},
// 搜索标题的最大层级, 1 - 6
depth: 4,
hideOtherSidebarContent: true, // 是否隐藏其他侧边栏内容
},
// pagination: {
// previousText: '上一节',
// nextText: '下一节',
// crossChapter: true,
// crossChapterText: true,
// },
count: {
countable: true,
fontsize: '1em',
color: 'rgb(90,90,90)',
language: 'chinese'
},
tabs: {
persist: true, // default
sync: true, // default
theme: 'classic', // default
tabComments: true, // default
tabHeadings: true // default
},
markdown: {
//If you have defined the follow section,
//then you need to follow the steps in the next section.
//(only the code section matters in this plugin)
/* SECTION START
code: function(code, lang){
some custom functions here
return some_custom_results;
}
SECTION END */
},
plugins: [
function (hook, vm) {
hook.beforeEach(function (html) {
let edit_url =
'https://github.com/ParallelLight/BioMeta/blob/main/' +
vm.route.file;
let editHtml = '[📝 编辑本文](' + edit_url + ')\n';
let client_id = 'a92890c1e5dcf9acdefa';
let client_secret = 'fc26d3e96e0d7aa349d505830e6075c626891cd2';
let date_url =
'https://api.github.com/repos/ParallelLight/BioMeta/commits?per_page=1&path=' +
vm.config.basePath +
encodeURIComponent(vm.route.file);
fetch(date_url, {
headers: {
Authorization: `${client_id}:${client_secret}`,
},
}).then((response) => {
return response.json();
})
.then((commits) => {
let modified = commits[0]['commit']['committer'][
'date'
].slice(0, 10);
document.getElementById('last-modified').textContent =
'更新日期: ' + modified;
});
return (
'<span id="last-modified">更新日期: 获取中</span>' +
'\n' +
html
);
// return (
// '<span id="last-modified">更新日期: 获取中</span>' +
// '\n' +
// html +
// '\n----\n' +
// editHtml
// );
});
hook.mounted(function () {
// 添加网站运行时间
let dom = Docsify.dom;
let runTimeNode = dom.create('div');
runTimeNode.className = 'runtime';
runTimeNode.style =
'color: #8590a6; max-width: 80%; margin: 0 auto 20px; padding: 0 15px 0 15px;';
dom.appendTo(dom.find('.content'), runTimeNode);
});
var footer = [
'<hr/>',
'<footer>',
'<span>Copyright © 2022. <a href="https://www.biometa.top">(@BioMeta)</a></span>',
// '<span>Proudly published with <a href="https://github.com/docsifyjs/docsify" target="_blank">docsify</a>.</span>',
'</footer>'
].join('');
hook.afterEach(function (html) {
return html + footer;
});
},
],
};
</script>
<!-- Docsify v4 -->
<!-- <script src="//cdn.jsdelivr.net/npm/docsify@4"></script> -->
<script src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></script>
<!-- search -->
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/search.min.js"></script>
<script src="//polyfill.io/v3/polyfill.min.js?features=String.prototype.normalize"></script>
<!-- zoom-image -->
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/zoom-image.min.js"></script>
<!-- copy-code -->
<script src="//cdn.jsdelivr.net/npm/docsify-copy-code/dist/docsify-copy-code.min.js"></script>
<!-- pagination -->
<!-- <script src="//cdn.jsdelivr.net/npm/docsify-pagination/dist/docsify-pagination.min.js"></script> -->
<!-- prismjs -->
<script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-bash.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-php.min.js"></script>
<!-- count -->
<script src="//unpkg.com/docsify-count/dist/countable.js"></script>
<!-- gitalk -->
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/gitalk.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/gitalk/dist/gitalk.min.js"></script>
<!-- md5 -->
<!-- <script src="https://cdn.bootcdn.net/ajax/libs/blueimp-md5/2.19.0/js/md5.min.js"></script> -->
<!-- to-top -->
<script src="https://unpkg.com/[email protected]/dist/vanilla-back-to-top.min.js"></script>
<!-- emoji -->
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/emoji.min.js"></script>
<!-- docsify-tabs -->
<script src="https://cdn.jsdelivr.net/npm/docsify-tabs@1"></script>
<!-- PDFObject.js is a required dependency of this plugin -->
<script src="//cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js"></script>
<!-- This is the source code of the pdf embed plugin -->
<script src="path-to-file/docsify-pdf-embed.js"></script>
<!-- or use this if you are not hosting the file yourself -->
<script src="//unpkg.com/docsify-pdf-embed-plugin/src/docsify-pdf-embed.js"></script>
<!-- gitalk -->
<script>
let props = {
clientID: 'a92890c1e5dcf9acdefa',
clientSecret: 'fc26d3e96e0d7aa349d505830e6075c626891cd2',
repo: 'BioMetaComments',
owner: 'ParallelLight',
admin: ['ParallelLight'],
distractionFreeMode: true,
id: decodeURI(location.hash.split('?')[0]),
};
let gitalk = new Gitalk(props);
// 哈希路由切换时 重新加载Gitalk
window.addEventListener('hashchange', onHashChange);
function onHashChange() {
props.id = decodeURI(location.hash.split('?')[0]); //如果不切分,在docsify里面的各个段落都会生成新的评论issue
}
</script>
<!-- searchInput -->
<script>
function change_search_plugin_order() {
let search_plugin = document.getElementsByClassName('search')[0];
let app_name = document.getElementsByClassName('app-name')[0];
search_plugin.parentNode.insertBefore(app_name, search_plugin);
}
setTimeout(change_search_plugin_order, 1);
</script>
<!-- toTopButton -->
<script>
addBackToTop({
diameter: 56,
backgroundColor: 'rgb(126, 195, 141)',
textColor: '#fff',
});
</script>
<!-- webSiteTime -->
<script>
function siteTime() {
setTimeout(siteTime, 1000);
let seconds = 1000;
let minutes = seconds * 60;
let hours = minutes * 60;
let days = hours * 24;
let today = new Date();
let todayYear = today.getFullYear();
let todayMonth = today.getMonth() + 1;
let todayDate = today.getDate();
let todayHour = today.getHours();
let todayMinute = today.getMinutes();
let todaySecond = today.getSeconds();
let t1 = Date.UTC(2022, 03, 21, 0, 0, 0);
let t2 = Date.UTC(
todayYear,
todayMonth,
todayDate,
todayHour,
todayMinute,
todaySecond
);
let diff = t2 - t1;
let diffDays = Math.floor(diff / days);
let diffHours = Math.floor((diff - diffDays * days) / hours);
let diffMinutes = Math.floor(
(diff - diffDays * days - diffHours * hours) / minutes
);
let diffSeconds = Math.floor(
(diff - diffDays * days - diffHours * hours - diffMinutes * minutes) /
seconds
);
Docsify.dom.find('.runtime').innerHTML =
'BioMeta已运行 ' +
diffDays +
' 天 ' +
diffHours +
' 小时 ' +
diffMinutes +
' 分 ' +
diffSeconds +
' 秒';
}
// 先让网页加载完,否则 Docsify.dom.find('.runtime') == null
setTimeout(siteTime, 500);
</script>
</body>
</html>