File tree 2 files changed +16
-1
lines changed
2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,9 @@ module.exports = {
65
65
sidebar : {
66
66
'/guide/' : genSidebarConfig ( 'Guide' ) ,
67
67
'/zh/guide/' : genSidebarConfig ( '指南' )
68
+ } ,
69
+ editLinkText : {
70
+ '/zh/' : '在 GitHub 上编辑此页'
68
71
}
69
72
}
70
73
}
@@ -82,6 +85,7 @@ function genSidebarConfig (title) {
82
85
'markdown' ,
83
86
'using-vue' ,
84
87
'custom-themes' ,
88
+ 'i18n' ,
85
89
'deploy'
86
90
]
87
91
}
Original file line number Diff line number Diff line change 2
2
<div class =" page" >
3
3
<Content :custom =" false" />
4
4
<div class =" content edit-link" v-if =" editLink" >
5
- <a :href =" editLink" target =" _blank" rel =" noopener noreferrer" >Edit this page </a >
5
+ <a :href =" editLink" target =" _blank" rel =" noopener noreferrer" >{{ editLinkText }} </a >
6
6
<OutboundLink />
7
7
</div >
8
8
<div class =" content page-nav" v-if =" prev || next" >
@@ -76,6 +76,17 @@ export default {
76
76
path
77
77
)
78
78
}
79
+ },
80
+ editLinkText () {
81
+ const defualtValue = ` Edit this page`
82
+ const { editLinkText } = this .$site .themeConfig
83
+ if (! editLinkText) {
84
+ return defualtValue
85
+ } else if (typeof editLinkText === ' string' ) {
86
+ return editLinkText
87
+ } else if (typeof editLinkText === ' object' ) {
88
+ return editLinkText[this .$localePath ] || defualtValue
89
+ }
79
90
}
80
91
}
81
92
}
You can’t perform that action at this time.
0 commit comments