mirror of
https://github.com/docsifyjs/docsify.git
synced 2025-12-08 19:55:52 +00:00
chore: fix edit docs button, fixed #562
This commit is contained in:
parent
845b1f2990
commit
78b3a6d007
@ -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…
x
Reference in New Issue
Block a user