Skip to content

Commit 46a234d

Browse files
authored
Fix "Edit this page" URL on docs pages (#703)
Closes #649
1 parent 002929d commit 46a234d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docusaurus.config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ const LOCALE_FULL_CODE = {
1717

1818
const PROJECT_NAME = 'pnpm.io'
1919

20+
const lastDocsVersion = '10.x';
21+
2022
function makeEditUrl (locale, path1, path2) {
2123
// Link to Crowdin for non-English docs
2224
if (locale !== DEFAULT_LOCALE) {
2325
return `https://translate.pnpm.io/project/pnpm/${LOCALE_FULL_CODE[locale] || locale}`;
2426
}
25-
if (path1 === 'versioned_docs/version-9.x') {
27+
if (path1 === `versioned_docs/version-${lastDocsVersion}`) {
2628
return `https://github.com/pnpm/${PROJECT_NAME}/edit/main/docs/${path2}`;
2729
}
2830
// Link to GitHub for English docs
@@ -59,7 +61,7 @@ module.exports={
5961
"path": "./docs",
6062
"routeBasePath": "/",
6163
"sidebarPath": path.join(__dirname, "sidebars.json"),
62-
lastVersion: '10.x',
64+
lastVersion: lastDocsVersion,
6365
},
6466
"gtag": {
6567
trackingID: "UA-91385296-1",

0 commit comments

Comments
 (0)