diff --git a/docs/index.html b/docs/index.html index 4de7d76..db555c0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -62,7 +62,13 @@ plugins: [ function (hook, vm) { hook.beforeEach(function (html) { - var url = 'https://github.com/docsifyjs/docsify/blob/master/docs/' + vm.route.file + 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/docsifyjs/docsify/blob/master/' + vm.route.file + } var editHtml = '[:memo: Edit Document](' + url + ')\n' return editHtml diff --git a/index.html b/index.html index 9593256..f15433b 100644 --- a/index.html +++ b/index.html @@ -42,7 +42,14 @@ plugins: [ function (hook, vm) { hook.beforeEach(function (html) { - var url = 'https://github.com/docsifyjs/docsify/blob/master/' + vm.route.file + var url + 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/docsifyjs/docsify/blob/master/' + vm.route.file + } var editHtml = '[:memo: Edit Document](' + url + ')\n' return editHtml