diff --git a/README.md b/README.md index a570148..16a2677 100644 --- a/README.md +++ b/README.md @@ -186,7 +186,6 @@ GitHub 技术社区 [Doocs](https://github.com/doocs) 旗下唯一公众号「**Doocs开源社区**」​,欢迎扫码关注,**专注分享技术领域相关知识及行业最新资讯**。当然,也可以加我个人微信(备注:GitHub),拉你进技术交流群。 - -
@@ -201,5 +200,4 @@ GitHub 技术社区 [Doocs](https://github.com/doocs) 旗下唯一公众号「**
diff --git a/index.html b/index.html index 31880d5..4141baf 100644 --- a/index.html +++ b/index.html @@ -72,15 +72,28 @@ } }, plugins: [ - function (hook) { - var footer = [ - '
', - '' - ].join('') + function (hook, vm) { + hook.beforeEach(function (html) { + const en = vm.route.file.indexOf('README_EN') > -1 + if (/githubusercontent\.com/.test(vm.route.file)) { + url = vm.route.file + .replace('raw.githubusercontent.com', 'github.com') + .replace(/\/master/, '/blob/master') + } else { + url = 'https://github.com/doocs/advanced-java/blob/master/' + vm.route.file + } + const edit = en ? 'Edit on GitHub' : '在 GitHub 编辑' + const editHtml = `[:memo: ${edit}](${url})\n` + return editHtml + html + }) hook.afterEach(function (html) { + const footer = [ + '
', + '' + ].join('') return html + footer }) }