Skip to content

Commit e35c118

Browse files
authored
fix i18n edit this page jump link (#1139)
1 parent 4874d97 commit e35c118

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

frontend/docusaurus.config.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,14 @@ const config: Config = {
170170
},
171171
// Please change this to your repo.
172172
// Remove this to remove the "edit this page" links.
173-
editUrl:
174-
"https://github.com/openmultiplayer/web/edit/master/frontend/",
173+
editUrl: ({ locale, version, versionDocsDirPath, docPath }) => {
174+
const baseUrl =
175+
"https://github.com/openmultiplayer/web/edit/master/frontend/";
176+
if (locale === "en") {
177+
return `${baseUrl}${versionDocsDirPath}/${docPath}`;
178+
}
179+
return `${baseUrl}i18n/${locale}/docusaurus-plugin-content-docs/${version}/${docPath}`;
180+
},
175181
},
176182
blog: {
177183
showReadingTime: true,

0 commit comments

Comments
 (0)