forked from ArchLinuxStudio/ShellTutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
249 lines (237 loc) · 8.75 KB
/
index.html
File metadata and controls
249 lines (237 loc) · 8.75 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="description"
content="Linux命令行与Shell脚本教程 包含常见命令行使用,Bash基础、进阶编程,以及实用范例!"
/>
<meta name="author" content="Ryosuke" />
<meta
name="keywords"
content="bash,脚本,脚本编程,Linux,OpenSource,Linux Shell,Bash,Linux命令行,"
/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta
name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
/>
<link rel="icon" href="./bash.png" />
<title>Linux命令行与Shell脚本教程</title>
<!-- Facebook Meta Tags -->
<meta
property="og:url"
content="https://archlinuxstudio.github.io/ShellTutorial/#/"
/>
<meta property="og:type" content="website" />
<meta property="og:title" content="Linux命令行与Shell脚本教程" />
<meta
property="og:description"
content="Linux命令行与Shell脚本教程 包含常见命令行使用,Bash基础、进阶编程,以及实用范例!"
/>
<meta
property="og:image"
content="https://raw.githubusercontent.com/ArchLinuxStudio/ShellTutorial/master/docs/bash.png"
/>
<meta property="og:site_name" content="ArchLinuxStudio" />
<!-- Twitter Meta Tags -->
<meta name="twitter:card" content="summary" />
<meta property="twitter:domain" content="archlinuxstudio.github.io" />
<meta
property="twitter:url"
content="https://archlinuxstudio.github.io/ShellTutorial/#/"
/>
<meta name="twitter:title" content="Linux命令行与Shell脚本教程" />
<meta
name="twitter:description"
content="Linux命令行与Shell脚本教程 包含常见命令行使用,Bash基础、进阶编程,以及实用范例!"
/>
<meta
name="twitter:image"
content="https://raw.githubusercontent.com/ArchLinuxStudio/ShellTutorial/master/docs/bash.png"
/>
<link
rel="stylesheet"
href="//cdn.jsdelivr.net/npm/docsify/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 {
padding-top: 10px;
background-color: rgb(216, 163, 25);
border-bottom: 4px solid rgb(42, 50, 56);
}
.app-name-link img {
width: 70%;
}
</style>
</head>
<body>
<div id="app">加载中...</div>
<script>
window.$docsify = {
search: {
placeholder: '搜索...',
},
name: 'Linux命令行与Shell脚本教程',
loadSidebar: true,
auto2top: true,
logo: './bash.svg',
topMargin: 50,
pagination: {
previousText: '上一节',
nextText: '下一节',
crossChapter: true,
crossChapterText: true,
},
notFoundPage: true,
subMaxLevel: 4,
themeColor: 'rgb(216,163,25)',
repo: 'https://github.com/ArchLinuxStudio/ShellTutorial',
formatUpdated: '{YYYY}-{MM}-{DD}',
plugins: [
function (hook, vm) {
hook.beforeEach(function (html) {
let edit_url =
'https://github.com/ArchLinuxStudio/ShellTutorial/blob/master/docs/' +
vm.route.file;
let editHtml = '[📝 编辑本文](' + edit_url + ')\n';
let client_id = '23877dc148472e3995b0';
let client_secret = 'af8a78b74c7e0b4f7ef141920e10cbbd047dfa87';
let date_url =
'https://api.github.com/repos/ArchLinuxStudio/ShellTutorial/commits?per_page=1&path=docs/' +
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 +
'\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);
});
},
],
};
</script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-bash.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-c.min.js"></script>
<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>
<script src="//cdn.jsdelivr.net/npm/docsify-pagination@2/dist/docsify-pagination.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/search.min.js"></script>
<script src="https://unpkg.com/vanilla-back-to-top@7.2.1/dist/vanilla-back-to-top.min.js"></script>
<script>
addBackToTop({
diameter: 56,
backgroundColor: 'rgb(216,163,25)',
textColor: '#fff',
});
</script>
<script>
let props = {
clientID: '23877dc148472e3995b0',
clientSecret: 'af8a78b74c7e0b4f7ef141920e10cbbd047dfa87',
repo: 'ShellTutorialComments',
owner: 'ArchLinuxStudio',
admin: ['ryosukeeeeee'],
// facebook-like distraction free mode
distractionFreeMode: false,
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>
<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>
<!-- 添加网站运行时间统计 -->
<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(2021, 02, 27, 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 =
'Shell Tutorial已运行 ' +
diffDays +
' 天 ' +
diffHours +
' 小时 ' +
diffMinutes +
' 分 ' +
diffSeconds +
' 秒';
}
// 先让网页加载完,否则 Docsify.dom.find('.runtime') == null
setTimeout(siteTime, 500);
</script>
</body>
</html>