Skip to content

Commit 729aa7e

Browse files
authored
Add @docusaurus/plugin-client-redirects (#157)
1 parent c9f7164 commit 729aa7e

File tree

3 files changed

+54
-1
lines changed

3 files changed

+54
-1
lines changed

docusaurus.config.js

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,37 @@ const config = {
9393
}),
9494
],
9595
],
96-
96+
9797
plugins: [
9898
require.resolve('docusaurus-plugin-image-zoom'),
9999
[
100+
// '@docusaurus/plugin-client-redirects',
101+
// {
102+
// fromExtensions: ['html', 'htm'], // /myPage.html -> /myPage
103+
// toExtensions: ['exe', 'zip'], // /myAsset -> /myAsset.zip (if latter exists)
104+
// redirects: [
105+
// // /docs/oldDoc -> /docs/newDoc
106+
// {
107+
// to: '/docs/newDoc',
108+
// from: '/docs/oldDoc',
109+
// },
110+
// // Redirect from multiple old paths to the new path
111+
// {
112+
// to: '/docs/newDoc2',
113+
// from: ['/docs/oldDocFrom2019', '/docs/legacyDocFrom2016'],
114+
// },
115+
// ],
116+
// createRedirects(existingPath) {
117+
// if (existingPath.includes('/community')) {
118+
// // Redirect from /docs/team/X to /community/X and /docs/support/X to /community/X
119+
// return [
120+
// existingPath.replace('/community', '/docs/team'),
121+
// existingPath.replace('/community', '/docs/support'),
122+
// ];
123+
// }
124+
// return undefined; // Return a falsy value: no redirect created
125+
// },
126+
// },
100127
'@docusaurus/plugin-pwa',
101128
{
102129
debug: true,

package-lock.json

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"dependencies": {
1818
"@crowdin/cli": "^3.19.4",
1919
"@docusaurus/core": "3.5.2",
20+
"@docusaurus/plugin-client-redirects": "3.5.2",
2021
"@docusaurus/plugin-content-docs": "3.5.2",
2122
"@docusaurus/plugin-google-gtag": "3.5.2",
2223
"@docusaurus/plugin-google-tag-manager": "3.5.2",

0 commit comments

Comments
 (0)