chore: fix edit docs button, fixed #562

fix/351
cinwellli 6 years ago
parent 845b1f2990
commit 78b3a6d007
  1. 8
      docs/index.html
  2. 9
      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

@ -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

Loading…
Cancel
Save