Skip to content

Commit 696b12a

Browse files
committed
chore: update index page
1 parent e562c4b commit 696b12a

2 files changed

Lines changed: 55 additions & 8 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,6 @@ GitHub 技术社区 [Doocs](https://github.com/doocs),致力于打造一个内
358358
</tr>
359359
</table>
360360

361-
关注「**Doocs 开源社区**」公众号,回复 **PDF**,即可获取 [doocs/advanced-java](https://github.com/doocs/advanced-java) 项目离线 PDF 文档(283 页精华),学习更加方便!
361+
关注「**Doocs 开源社区**」公众号,回复 **PDF**,即可获取 [互联网 Java 工程师进阶知识完全扫盲](https://github.com/doocs/advanced-java) 项目离线 PDF 文档(283 页精华),学习更加方便!
362362

363363
![](./images/pdf.png)

index.html

Lines changed: 54 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,62 @@
7171
}
7272
},
7373
plugins: [
74-
function (hook) {
75-
var footer = [
76-
"<hr/>",
77-
"<footer>",
78-
'<span>Copyright © 2018-2021 <a href="https://github.com/doocs" target="_blank">Doocs</a>. All rights reserved.',
79-
"</footer>",
80-
].join("");
74+
function (hook, vm) {
75+
hook.beforeEach(function (content) {
76+
const en = vm.route.file.indexOf("README_EN") > -1;
77+
if (/githubusercontent\.com/.test(vm.route.file)) {
78+
url = vm.route.file
79+
.replace("raw.githubusercontent.com", "github.com")
80+
.replace(/\/main/, "/blob/main");
81+
} else {
82+
url =
83+
"https://github.com/doocs/source-code-hunter/blob/main/" +
84+
vm.route.file;
85+
}
86+
87+
const github = `[GitHub](${url})`;
88+
const gitee = `[Gitee](${url.replace("github", "gitee")})`;
89+
90+
const editHtml = en
91+
? `:memo: Edit on ${github} / ${gitee}\n`
92+
: `:memo: 在 ${github} / ${gitee} 编辑\n`;
93+
94+
if (vm.route.path == "/") {
95+
return editHtml + content;
96+
}
97+
const subscription = `
98+
## 公众号
99+
100+
[Doocs](https://github.com/doocs) 技术社区旗下唯一公众号「**Doocs开源社区**」​,欢迎扫码关注,**专注分享技术领域相关知识及业内最新资讯**。当然,也可以加我个人微信(备注:GitHub),拉你进技术交流群。
101+
102+
关注「**Doocs 开源社区**」公众号,回复 **PDF**,即可获取 [互联网 Java 工程师进阶知识完全扫盲](https://github.com/doocs/advanced-java) 项目离线 PDF 文档(283 页精华),学习更加方便!
103+
104+
<table>
105+
<tr>
106+
<td align="center" style="width: 200px;">
107+
<a href="https://github.com/doocs">
108+
<img src="./images/qrcode-for-doocs.jpg" style="width: 400px;"><br>
109+
<sub>公众平台</sub>
110+
</a><br>
111+
</td>
112+
<td align="center" style="width: 200px;">
113+
<a href="https://github.com/yanglbme">
114+
<img src="./images/qrcode-for-yanglbme.jpg" style="width: 400px;"><br>
115+
<sub>个人微信</sub>
116+
</a><br>
117+
</td>
118+
</tr>
119+
</table>
120+
`;
121+
return editHtml + content + `\n` + subscription;
122+
});
81123

82124
hook.afterEach(function (html) {
125+
const footer = [
126+
"<footer>",
127+
'<span>Copyright © 2018-2021 <a href="https://github.com/doocs" target="_blank">Doocs</a>. All rights reserved.',
128+
"</footer>",
129+
].join("");
83130
return html + footer;
84131
});
85132
},

0 commit comments

Comments
 (0)