This repository was archived by the owner on Dec 23, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-9
lines changed Expand file tree Collapse file tree 2 files changed +16
-9
lines changed Original file line number Diff line number Diff line change 27
27
< div id ="app "> </ div >
28
28
< script >
29
29
// Set html "lang" attribute based on URL
30
- var lang = location . hash . match ( / \# ( z h - c n ) / ) ;
31
- console . log ( location ) ;
30
+ let lang = location . hash . match ( / \# ( z h - c n ) / ) ;
31
+ // console.log(location);
32
32
if ( lang ) {
33
33
document . documentElement . setAttribute ( "lang" , lang [ 1 ] ) ;
34
34
}
35
35
36
36
window . $docsify = {
37
37
name : "mirr.one" ,
38
- elativePath : true ,
38
+ relativePath : false ,
39
39
coverpage : {
40
40
"/" : "_coverpage.md" ,
41
41
"/zh-cn" : "zh-cn/_coverpage.md" ,
44
44
loadSidebar : true ,
45
45
nameLink : {
46
46
"/" : "#/" ,
47
- "/zh-cn" : "#/zh-cn" ,
47
+ "/zh-cn/ " : "#/zh-cn/ " ,
48
48
} ,
49
49
search : {
50
50
paths : "auto" ,
63
63
"(.*)/CHANGELOG" : "/CHANGELOG.md" ,
64
64
65
65
// prepare for gitLocalize
66
- "/zh-cn/ " : "/lang_i18n/zh-CN/README.md" ,
66
+ // "/zh-cn": "/lang_i18n/zh-CN/README.md",
67
67
"/zh-cn/(.*)" : "/lang_i18n/zh-CN/$1" ,
68
68
} ,
69
69
plugins : [
70
70
function ( hook , vm ) {
71
- let footer = `>---
71
+ const lang_i18n = [ "/" , "/zh-cn/" ] ;
72
+
73
+ const footer = `>---
72
74
## Sponsors
73
75
- [Fastly](https://www.fastly.com/)
74
76
` ;
96
98
97
99
let editHtml = "\n[:memo: Edit Document](" + url + ")\n" ;
98
100
99
- if ( vm . route . path === "/" ) {
100
- return html + editHtml ;
101
+ let path = vm . route . path ;
102
+ // console.log(path);
103
+
104
+ for ( let i = 0 ; i < lang_i18n . length ; i ++ ) {
105
+ if ( path === lang_i18n [ i ] ) {
106
+ return html + editHtml ;
107
+ }
101
108
}
102
109
103
110
return html + editHtml + footer ;
Original file line number Diff line number Diff line change @@ -48,4 +48,4 @@ replace url
48
48
49
49
> ** ![ WARNING] Don't download resource with multi-thread downloader, which will spend a lot of request quota.**
50
50
51
- ![ B2 warning] ( /_images/b2-warning.jpg )
51
+ ![ B2 warning] ( .. /_images/b2-warning.jpg)
You can’t perform that action at this time.
0 commit comments