Skip to content

Commit

Permalink
feat: add howto redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
benfurber committed Jan 6, 2025
1 parent 2b6a3c7 commit a0e939c
Show file tree
Hide file tree
Showing 3 changed files with 7,598 additions and 102 deletions.
1 change: 1 addition & 0 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"debug": "node --nolazy --inspect-brk=9229 ./node_modules/docusaurus/lib/start-server.js"
},
"devDependencies": {
"@docusaurus/plugin-client-redirects": "^3.7.0",
"docusaurus": "^1.14.3"
}
}
26 changes: 22 additions & 4 deletions website/siteConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ const siteConfig = {
// For no header links in the top nav bar -> headerLinks: [],
headerLinks: [{ doc: "intro", label: "Academy" }],




/* path to images for header/footer */
headerIcon: "img/favicon.ico",
footerIcon: "img/favicon.ico",
Expand Down Expand Up @@ -97,11 +94,32 @@ const siteConfig = {
// collapsie menu: true,
docsSideNavCollapsible: true,
// Show documentation's last update time.
enableUpdateTime: true
enableUpdateTime: true,

// You may provide arbitrary config keys to be used as needed by your
// template. For example, if you need your repo's URL...
// repoUrl: 'https://github.com/facebook/test-site',

plugins: [
[
'@docusaurus/plugin-client-redirects',
{
fromExtensions: ['html', 'htm'], // /myPage.html -> /myPage
toExtensions: ['exe', 'zip'], // /myAsset -> /myAsset.zip (if latter exists)
redirects: [],
createRedirects(existingPath) {
if (existingPath.includes('/howto')) {
// Redirect from /docs/team/X to /community/X and /docs/support/X to /community/X
return [
existingPath.replace('/howto', '/library'),
existingPath.replace('/howto', '/library'),
];
}
return undefined; // Return a falsy value: no redirect created
},
},
],
],
};

module.exports = siteConfig;
Loading

0 comments on commit a0e939c

Please sign in to comment.