File tree 4 files changed +8
-5
lines changed
4 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 33
33
subMaxLevel : 0 ,
34
34
mergeNavbar : true ,
35
35
formatUpdated : '{MM}/{DD} {HH}:{mm}' ,
36
- routerMode : 'history' ,
37
36
plugins : [
38
37
function ( hook , vm ) {
39
38
hook . beforeEach ( function ( html ) {
40
- var url = 'https://github.com/QingWei-Li/docsify/blob/master' + vm . router . getFile ( )
39
+ var url = 'https://github.com/QingWei-Li/docsify/blob/master/ ' + vm . route . file
41
40
var editHtml = '[:memo: Edit Document](' + url + ')\n'
42
41
43
42
return editHtml
Original file line number Diff line number Diff line change 53
53
plugins : [
54
54
function ( hook , vm ) {
55
55
hook . beforeEach ( function ( html ) {
56
- var url = 'https://github.com/QingWei-Li/docsify/blob/master/docs' + vm . route . file
56
+ var url = 'https://github.com/QingWei-Li/docsify/blob/master/docs/ ' + vm . route . file
57
57
var editHtml = '[:memo: Edit Document](' + url + ')\n'
58
58
59
59
return editHtml
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ export class History {
22
22
return this . config . basePath
23
23
}
24
24
25
- getFile ( path ) {
25
+ getFile ( path , isRelative ) {
26
26
path = path || this . getCurrentPath ( )
27
27
28
28
const { config } = this
@@ -33,6 +33,10 @@ export class History {
33
33
path = path === '/README.md' ? ( config . homepage || path ) : path
34
34
path = isAbsolutePath ( path ) ? path : getPath ( base , path )
35
35
36
+ if ( isRelative ) {
37
+ path = path . replace ( new RegExp ( `^${ base } ` ) , '' )
38
+ }
39
+
36
40
return path
37
41
}
38
42
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ export class HashHistory extends History {
71
71
72
72
return {
73
73
path,
74
- file : this . getFile ( path ) ,
74
+ file : this . getFile ( path , true ) ,
75
75
query : parseQuery ( query )
76
76
}
77
77
}
You can’t perform that action at this time.
0 commit comments