|
43 | 43 | window.$docsify = {
|
44 | 44 | name: 'leetcode',
|
45 | 45 | repo: 'doocs/leetcode',
|
| 46 | + lastModifiedText: isEn() ? 'Last updated: ' : '最近更新时间:', |
46 | 47 | logo: '/images/doocs-leetcode.png',
|
47 | 48 | search: {
|
48 | 49 | depth: 2,
|
|
128 | 129 | return html + footer
|
129 | 130 | })
|
130 | 131 | },
|
131 |
| - (hook, vm) => { |
132 |
| - hook.beforeEach((html) => { |
133 |
| - function formatDateTime(dateTimeString) { |
134 |
| - const date = new Date(dateTimeString); |
135 |
| - const year = date.getFullYear(); |
136 |
| - const month = String(date.getMonth() + 1).padStart(2, '0'); |
137 |
| - const day = String(date.getDate()).padStart(2, '0'); |
138 |
| - const hours = String(date.getHours()).padStart(2, '0'); |
139 |
| - const minutes = String(date.getMinutes()).padStart(2, '0'); |
140 |
| - const seconds = String(date.getSeconds()).padStart(2, '0'); |
141 |
| - return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
142 |
| - } |
143 |
| - const { file } = vm.route |
144 |
| - const apiUrl = `https://api.github.com/repos/${$docsify.repo}/commits?path=${file}`; |
145 |
| - fetch(apiUrl, { method: 'GET' }).then(response => response.json()) |
146 |
| - .then(data => { |
147 |
| - const date = data[0].commit.committer.date |
148 |
| - const commitUrl = `https://github.com/${$docsify.repo}/commits/main/${file}` |
149 |
| - const lastModified = formatDateTime(date) |
150 |
| - const prompt = isEn() ? 'Last updated: ' : '最近更新时间:' |
151 |
| - const lastModifiedContent = ` |
152 |
| - <blockquote> |
153 |
| - <a href="${commitUrl}" target="_blank" style="color: #858585">${prompt + lastModified}</a> |
154 |
| - </blockquote> |
155 |
| - ` |
156 |
| - document.getElementById('last-modified').innerHTML = lastModifiedContent |
157 |
| - }) |
158 |
| - return ( |
159 |
| - html + '<span id="last-modified"></span>' |
160 |
| - ); |
161 |
| - }); |
162 |
| - }, |
163 | 132 | ]
|
164 | 133 | }
|
165 | 134 | </script>
|
166 | 135 | <script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify@4.13.0/lib/docsify.min.js"></script>
|
| 136 | + <!-- components --> |
167 | 137 | <script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/prismjs/components/prism-c.min.js"></script>
|
168 | 138 | <script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/prismjs/components/prism-go.min.js"></script>
|
169 | 139 | <script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/prismjs/components/prism-sql.min.js"></script>
|
|
180 | 150 | <script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/prismjs/components/prism-ruby.min.js"></script>
|
181 | 151 | <script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/prismjs/components/prism-rust.min.js"></script>
|
182 | 152 | <script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify-copy-code@2.1.1/dist/docsify-copy-code.min.js"></script>
|
| 153 | + <!-- plugins --> |
183 | 154 | <script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify/lib/plugins/search.min.js"></script>
|
184 | 155 | <script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify/lib/plugins/zoom-image.min.js"></script>
|
| 156 | + <script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify-lastmodified/index.min.js"></script> |
185 | 157 | <script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify-tabs@1/dist/docsify-tabs@1.js"></script>
|
186 | 158 | <script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify-pagination/dist/docsify-pagination.min.js"></script>
|
187 | 159 | <script src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/docsify-darklight-theme@latest/dist/index.min.js"></script>
|
|
0 commit comments