Created
October 21, 2021 03:37
-
-
Save rogeruiz/875fa7fcb21ce53f521a79ea9a59ba56 to your computer and use it in GitHub Desktop.
Helpful for doing redirects on pages that we drastically changed for MilMove Docusaurus
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
M docs/backend/guides/_category_.json | |
@@ -1,5 +1,5 @@ | |
{ | |
"label": "Guides", | |
"position": 3, | |
- "collapsed": true | |
+ "collapsed": false | |
} | |
M docusaurus.config.js | |
@@ -167,5 +167,20 @@ module.exports = { | |
], | |
plugins: [ | |
require.resolve('@cmfcmf/docusaurus-search-local'), | |
+ [ | |
+ '@docusaurus/plugin-client-redirects', | |
+ { | |
+ createRedirects: (existingPath) => { | |
+ if (existingPath === '/docs/backend/guides/how-to-handle-errors') { | |
+ return [ | |
+ '/docs/backend/guides/handle-backend-errors', | |
+ '/docs/backend/guides/handle-backend-errors/', | |
+ '/docs/dev/contributing/backend/handle-backend-errors', | |
+ '/docs/dev/contributing/backend/handle-backend-errors/', | |
+ ]; | |
+ } | |
+ }, | |
+ } | |
+ ], | |
], | |
}; | |
M package.json | |
@@ -16,6 +16,7 @@ | |
"dependencies": { | |
"@cmfcmf/docusaurus-search-local": "^0.6.6", | |
"@docusaurus/core": "2.0.0-beta.5", | |
+ "@docusaurus/plugin-client-redirects": "2.0.0-beta.5", | |
"@docusaurus/preset-classic": "2.0.0-beta.5", | |
"@mdx-js/react": "^1.6.21", | |
"@svgr/webpack": "^5.5.0", | |
M yarn.lock |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment