|
120 | 120 | window.$docsify = {
|
121 | 121 | loadNavbar: true,
|
122 | 122 | search: {
|
123 | | - placeholder: '搜索...', |
| 123 | + placeholder: "搜索...", |
124 | 124 | },
|
125 | | - name: 'Arch Linux 安装使用教程 - ArchTutorial - Arch Linux Studio', |
| 125 | + name: "Arch Linux 安装使用教程 - ArchTutorial - Arch Linux Studio", |
126 | 126 | loadSidebar: true,
|
127 | 127 | auto2top: true,
|
128 | | - logo: './arch.svg', |
| 128 | + logo: "./arch.svg", |
129 | 129 | topMargin: 90,
|
130 | 130 | notFoundPage: true,
|
131 | 131 | subMaxLevel: 4,
|
132 | | - themeColor: 'rgb(23,147,209)', |
133 | | - repo: 'https://github.com/ArchLinuxStudio/ArchLinuxTutorial', |
134 | | - formatUpdated: '{YYYY}-{MM}-{DD}', |
| 132 | + themeColor: "rgb(23,147,209)", |
| 133 | + repo: "https://github.com/ArchLinuxStudio/ArchLinuxTutorial", |
| 134 | + formatUpdated: "{YYYY}-{MM}-{DD}", |
135 | 135 | pagination: {
|
136 | | - previousText: 'Previous', |
137 | | - nextText: 'Next', |
| 136 | + previousText: "Previous", |
| 137 | + nextText: "Next", |
138 | 138 | crossChapter: true,
|
139 | 139 | crossChapterText: true,
|
140 | 140 | },
|
141 | 141 | plugins: [
|
142 | 142 | function (hook, vm) {
|
143 | 143 | hook.beforeEach(function (html) {
|
144 | 144 | let edit_url =
|
145 | | - 'https://github.com/ArchLinuxStudio/ArchLinuxTutorial/blob/master/docs/' + |
| 145 | + "https://github.com/ArchLinuxStudio/ArchLinuxTutorial/blob/master/docs/" + |
146 | 146 | vm.route.file;
|
147 | | - let editHtml = '[📝 Edit This Page](' + edit_url + ')\n'; |
| 147 | + let editHtml = "[📝 Edit This Page](" + edit_url + ")\n"; |
148 | 148 |
|
149 | | - let client_id = '296c581fc4b2a837a1e3'; |
150 | | - let client_secret = '7e7f0ad1809fa4a1915430ade04835f6849ab56a'; |
| 149 | + let client_id = "296c581fc4b2a837a1e3"; |
| 150 | + let client_secret = "7e7f0ad1809fa4a1915430ade04835f6849ab56a"; |
151 | 151 |
|
152 | 152 | let date_url =
|
153 | | - 'https://api.github.com/repos/ArchLinuxStudio/ArchLinuxTutorial/commits?per_page=1&path=docs/' + |
| 153 | + "https://api.github.com/repos/ArchLinuxStudio/ArchLinuxTutorial/commits?per_page=1&path=docs/" + |
154 | 154 | vm.config.basePath +
|
155 | 155 | encodeURIComponent(vm.route.file);
|
156 | 156 |
|
|
163 | 163 | return response.json();
|
164 | 164 | })
|
165 | 165 | .then((commits) => {
|
166 | | - let modified = commits[0]['commit']['committer'][ |
167 | | - 'date' |
| 166 | + let modified = commits[0]["commit"]["committer"][ |
| 167 | + "date" |
168 | 168 | ].slice(0, 10);
|
169 | | - document.getElementById('last-modified').textContent = |
170 | | - 'Update date: ' + modified; |
| 169 | + document.getElementById("last-modified").textContent = |
| 170 | + "Update date: " + modified; |
171 | 171 | });
|
172 | 172 |
|
173 | 173 | return (
|
174 | 174 | '<span id="last-modified">Update date: Fetching...</span>' +
|
175 | | - '\n' + |
| 175 | + "\n" + |
176 | 176 | html +
|
177 | | - '\n----\n' + |
| 177 | + "\n----\n" + |
178 | 178 | editHtml
|
179 | 179 | );
|
180 | 180 | });
|
181 | 181 |
|
182 | 182 | hook.mounted(function () {
|
183 | 183 | // 添加网站运行时间
|
184 | 184 | let dom = Docsify.dom;
|
185 | | - let runTimeNode = dom.create('div'); |
186 | | - runTimeNode.className = 'runtime'; |
| 185 | + let runTimeNode = dom.create("div"); |
| 186 | + runTimeNode.className = "runtime"; |
187 | 187 | runTimeNode.style =
|
188 | | - 'color: #8590a6;max-width: 80%;margin: 0 auto 20px;padding: 0 15px 0 15px;'; |
189 | | - dom.appendTo(dom.find('.content'), runTimeNode); |
| 188 | + "color: #8590a6;max-width: 80%;margin: 0 auto 20px;padding: 0 15px 0 15px;"; |
| 189 | + dom.appendTo(dom.find(".content"), runTimeNode); |
190 | 190 | });
|
191 | 191 | },
|
192 | 192 | ],
|
|
209 | 209 | <script>
|
210 | 210 | addBackToTop({
|
211 | 211 | diameter: 56,
|
212 | | - backgroundColor: 'rgb(23,147,209)', |
213 | | - textColor: '#fff', |
| 212 | + backgroundColor: "rgb(23,147,209)", |
| 213 | + textColor: "#fff", |
214 | 214 | });
|
215 | 215 | </script>
|
216 | 216 |
|
217 | 217 | <script>
|
218 | | - let client_id = '296c581fc4b2a837a1e3'; |
219 | | - let client_secret = '7e7f0ad1809fa4a1915430ade04835f6849ab56a'; |
| 218 | + let client_id = "296c581fc4b2a837a1e3"; |
| 219 | + let client_secret = "7e7f0ad1809fa4a1915430ade04835f6849ab56a"; |
220 | 220 |
|
221 | 221 | let props = {
|
222 | 222 | clientID: client_id,
|
223 | 223 | clientSecret: client_secret,
|
224 | | - repo: 'ArchLinuxTutorialComments', |
225 | | - owner: 'ArchLinuxStudio', |
226 | | - admin: ['ryosukeeeeee'], |
| 224 | + repo: "ArchLinuxTutorialComments", |
| 225 | + owner: "ArchLinuxStudio", |
| 226 | + admin: ["ryosukeeeeee"], |
227 | 227 | // facebook-like distraction free mode
|
228 | 228 | distractionFreeMode: false,
|
229 | | - id: decodeURI(location.hash.split('?')[0]), |
230 | | - language: 'en', |
| 229 | + id: decodeURI(location.hash.split("?")[0]), |
| 230 | + language: "en", |
231 | 231 | };
|
232 | 232 | let gitalk = new Gitalk(props);
|
233 | 233 | // 哈希路由切换时 重新加载Gitalk
|
234 | | - window.addEventListener('hashchange', onHashChange); |
| 234 | + window.addEventListener("hashchange", onHashChange); |
235 | 235 | function onHashChange() {
|
236 | | - props.id = decodeURI(location.hash.split('?')[0]); //如果不切分,在docsify里面的各个段落都会生成新的评论issue |
| 236 | + props.id = decodeURI(location.hash.split("?")[0]); //如果不切分,在docsify里面的各个段落都会生成新的评论issue |
237 | 237 | }
|
238 | 238 | </script>
|
239 | 239 | <script>
|
240 | 240 | function change_search_plugin_order() {
|
241 | | - let search_plugin = document.getElementsByClassName('search')[0]; |
242 | | - let app_name = document.getElementsByClassName('app-name')[0]; |
| 241 | + let search_plugin = document.getElementsByClassName("search")[0]; |
| 242 | + let app_name = document.getElementsByClassName("app-name")[0]; |
243 | 243 | search_plugin.parentNode.insertBefore(app_name, search_plugin);
|
244 | 244 | }
|
245 | 245 | setTimeout(change_search_plugin_order, 1);
|
|
261 | 261 | let todayMinute = today.getMinutes();
|
262 | 262 | let todaySecond = today.getSeconds();
|
263 | 263 |
|
264 | | - let t1 = Date.UTC(2020, 09, 1, 0, 0, 0); |
| 264 | + let t1 = Date.UTC(2020, 9, 1, 0, 0, 0); |
265 | 265 | let t2 = Date.UTC(
|
266 | 266 | todayYear,
|
267 | 267 | todayMonth,
|
|
280 | 280 | (diff - diffDays * days - diffHours * hours - diffMinutes * minutes) /
|
281 | 281 | seconds
|
282 | 282 | );
|
283 | | - Docsify.dom.find('.runtime').innerHTML = |
284 | | - 'Arch Linux Studio has been running for ' + |
| 283 | + Docsify.dom.find(".runtime").innerHTML = |
| 284 | + "Arch Linux Studio has been running for " + |
285 | 285 | diffDays +
|
286 | | - ' days ' + |
| 286 | + " days " + |
287 | 287 | diffHours +
|
288 | | - ' hours ' + |
| 288 | + " hours " + |
289 | 289 | diffMinutes +
|
290 | | - ' minutes ' + |
| 290 | + " minutes " + |
291 | 291 | diffSeconds +
|
292 | | - ' seconds'; |
| 292 | + " seconds"; |
293 | 293 | }
|
294 | 294 | // 先让网页加载完,否则 Docsify.dom.find('.runtime') == null
|
295 | 295 | setTimeout(siteTime, 500);
|
|
0 commit comments