Skip to content

Commit ff61ae2

Browse files
committed
feat: add netlify site for leetcode project
See https://lc.netlify.com
1 parent f74af76 commit ff61ae2

File tree

3 files changed

+15
-18
lines changed

3 files changed

+15
-18
lines changed

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818
[English Version](/README_EN.md)
1919

2020
## 站点
21+
- Netlify: https://lc.netlify.com
2122
- GitHub Pages: https://doocs.github.io/leetcode
2223
- Coding Pages: https://d3jc40.coding-pages.com
2324

24-
注:[GitHub Pages](https://doocs.github.io/leetcode) 访问加载过慢,可访问 [Coding Pages](https://d3jc40.coding-pages.com)
25+
注:对于国内(中国)的朋友,推荐访问 [Coding Pages](https://d3jc40.coding-pages.com),页面加载速度最快
2526

2627
## 题解
2728
- [LeetCode](/solution/README.md)
@@ -36,7 +37,7 @@
3637

3738
如果你对本项目感兴趣,并且希望加入我们刷题大军,欢迎随时提交 [PR](https://github.com/doocs/leetcode/pulls)。请参考如下步骤:
3839

39-
-[本项目](https://github.com/doocs/leetcode) <kbd>Fork</kbd> 到你的个人 GitHub 帐户,然后 <kbd>clone</kbd> 到你的本地机器;
40+
-[本项目](https://github.com/doocs/leetcode) <kbd>fork</kbd> 到你的个人 GitHub 帐户,然后 <kbd>clone</kbd> 到你的本地机器;
4041
- 对项目做出一些变更,然后使用 git <kbd>add</kbd>、<kbd>commit</kbd>、<kbd>push</kbd> 等命令将你的变更提交到你的远程 GitHub 仓库;
4142
- 将你的变更以 PR 的形式提交过来,项目的维护人员会在第一时间对你的变更进行 review!
4243
- 你也可以参考 [GitHub 帮助文档](https://help.github.com/cn) 了解更多细节。

README_EN.md

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Complete solutions to [LeetCode](https://leetcode-cn.com/problemset/all/), [LCOF
1818
[中文文档](/README.md)
1919

2020
## Sites
21+
- Netlify: https://lc.netlify.com
2122
- GitHub Pages: https://doocs.github.io/leetcode
2223
- Coding Pages: https://d3jc40.coding-pages.com
2324

index.html

+11-16
Original file line numberDiff line numberDiff line change
@@ -41,31 +41,26 @@
4141
}
4242
},
4343
plugins: [
44-
function (hook) {
45-
var footer = [
46-
'<hr/>',
47-
'<footer>',
48-
'<span>Copyright © 2018-2020 <a href="https://github.com/doocs" target="_blank">Doocs</a>. All rights reserved.',
49-
'</footer>'
50-
].join('')
51-
52-
hook.afterEach(function (html) {
53-
return html + footer
54-
})
55-
},
5644
function (hook, vm) {
5745
hook.beforeEach(function (html) {
58-
var englishVersion = vm.route.file.indexOf('README_EN') != -1
46+
const en = vm.route.file.indexOf('README_EN') > -1
5947
if (/githubusercontent\.com/.test(vm.route.file)) {
6048
url = vm.route.file
6149
.replace('raw.githubusercontent.com', 'github.com')
6250
.replace(/\/master/, '/blob/master')
6351
} else {
6452
url = 'https://github.com/doocs/leetcode/blob/master/' + vm.route.file
6553
}
66-
var editHtml = '[:memo: 在 GitHub 编辑](' + url + ')\n'
67-
var editHtmlEN = '[:memo: Edit on GitHub](' + url + ')\n'
68-
return (englishVersion ? editHtmlEN : editHtml) + html
54+
const edit = en ? 'Edit on GitHub' : '在 GitHub 编辑'
55+
const editHtml = `[:memo: ${edit}](${url})\n`
56+
return editHtml + html
57+
})
58+
59+
hook.afterEach(function (html) {
60+
const en = vm.route.file.indexOf('README_EN') != -1
61+
const copyright = en ? '. All Rights Reserved' : ' 版权所有'
62+
const footer = `<footer><span>Copyright © 2018-2020 <a href="https://github.com/doocs" target="_blank">Doocs</a>${copyright}</footer>`
63+
return html + footer
6964
})
7065
},
7166
]

0 commit comments

Comments
 (0)