Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions website/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,32 @@ const config: Config = {
],
},
],
[
'@docusaurus/plugin-client-redirects',
{
// Create redirects from the available routes that have already been created
createRedirects(existingPath) {
// Only evaluate paths related to documentation
if (!existingPath.startsWith('/docs/')) {
return undefined;
}

// Extract the relative path after /docs/
const relativeDocsPath = existingPath.substring(6);
const firstSegment = relativeDocsPath.split('/')[0];

// Exclude any known version identifiers aligned with existing routes
const existingVersionedRoutes = ['next', ...Object.keys(versionsMap)];
if (existingVersionedRoutes.includes(firstSegment)) {
return undefined;
}

// Redirect the explicit versioned path to the implicit unversioned path
return [`/docs/${latestVersion}${existingPath.replace('/docs', '')}`];
},
},
],

],
themeConfig: {
image: 'img/logo/png/colored_logo.png',
Expand Down
1 change: 1 addition & 0 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"dependencies": {
"@docusaurus/core": "^3.9.2",
"@docusaurus/plugin-pwa": "^3.9.2",
"@docusaurus/plugin-client-redirects": "^3.9.2",
"@docusaurus/preset-classic": "^3.9.2",
"@mdx-js/react": "^3.0.0",
"algoliasearch": "^5.10.2",
Expand Down