|
71 | 71 | } |
72 | 72 | }, |
73 | 73 | 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 | + }); |
81 | 123 |
|
82 | 124 | 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(""); |
83 | 130 | return html + footer; |
84 | 131 | }); |
85 | 132 | }, |
|
0 commit comments