Skip to content

Commit 2cf6fd8

Browse files
committed
fix Edit Document
1 parent 0bbc02c commit 2cf6fd8

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

docs/index.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
'.*?/awesome': 'https://raw.githubusercontent.com/docsifyjs/awesome-docsify/master/README.md',
3333
'.*?/changelog': 'https://raw.githubusercontent.com/docsifyjs/docsify/master/CHANGELOG.md',
3434
'/.*/_navbar.md': '/_navbar.md',
35-
'/zh-cn/(.*)': 'https://cdn.jsdelivr.net/gh/docsifyjs/docs-zh/$1',
35+
'/zh-cn/(.*)': 'https://cdn.jsdelivr.net/gh/docsifyjs/docs-zh@master/$1',
3636
'/de-de/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-de/master/$1',
3737
'/ru/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-ru/master/$1',
3838
'/es/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-es/master/$1'
@@ -77,6 +77,10 @@
7777
url = vm.route.file
7878
.replace('raw.githubusercontent.com', 'github.com')
7979
.replace(/\/master/, '/blob/master')
80+
} else if (/jsdelivr\.net/.test(vm.route.file)) {
81+
url = vm.route.file
82+
.replace('cdn.jsdelivr.net/gh', 'github.com')
83+
.replace('@master', '/blob/master')
8084
} else {
8185
url = 'https://github.com/docsifyjs/docsify/blob/master/docs/' + vm.route.file
8286
}

index.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
'.*?/awesome': 'https://raw.githubusercontent.com/docsifyjs/awesome-docsify/master/README.md',
2525
'.*?/changelog': 'https://raw.githubusercontent.com/docsifyjs/docsify/master/CHANGELOG.md',
2626
'/.*/_navbar.md': '/_navbar.md',
27-
'/zh-cn/(.*)': 'https://cdn.jsdelivr.net/gh/docsifyjs/docs-zh/$1',
27+
'/zh-cn/(.*)': 'https://cdn.jsdelivr.net/gh/docsifyjs/docs-zh@master/$1',
2828
'/de-de/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-de/master/$1',
2929
'/ru/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-ru/master/$1',
3030
'/es/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-es/master/$1'
@@ -60,6 +60,10 @@
6060
url = vm.route.file
6161
.replace('raw.githubusercontent.com', 'github.com')
6262
.replace(/\/master/, '/blob/master')
63+
} else if (/jsdelivr\.net/.test(vm.route.file)) {
64+
url = vm.route.file
65+
.replace('cdn.jsdelivr.net/gh', 'github.com')
66+
.replace('@master', '/blob/master')
6367
} else {
6468
url = 'https://github.com/docsifyjs/docsify/blob/master/docs/' + vm.route.file
6569
}

0 commit comments

Comments
 (0)