Skip to content

Commit fabb800

Browse files
mnenciagbartolini
authored andcommitted
fix(redirects): add /current path support for latest version
The /current and /current/* paths were not accessible, causing 404 errors for external references. This implements native Docusaurus redirects using the createRedirects function to automatically map all /current/* paths to the corresponding paths in the latest version. Closes #24 Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
1 parent cb5cfe6 commit fabb800

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

website/docusaurus.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,13 @@ const config: Config = {
197197
from: '/',
198198
},
199199
],
200+
createRedirects(existingPath) {
201+
// Redirect /current/* to the latest version
202+
if (existingPath.startsWith(`/${lastVersion}/`)) {
203+
return existingPath.replace(`/${lastVersion}/`, '/current/');
204+
}
205+
return undefined;
206+
},
200207
},
201208
],
202209
],

0 commit comments

Comments
 (0)