Skip to content

Commit 432f431

Browse files
Redirects for latest->v11, next->v12
1 parent 5473892 commit 432f431

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

next.config.mjs

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -84,20 +84,6 @@ const config = {
8484
config.plugins.push(new ProvidePlugin({ React: "react" }));
8585
return config;
8686
},
87-
async rewrites() {
88-
return {
89-
beforeFiles: [
90-
{
91-
source: "/docs/manual/latest/:slug",
92-
destination: `/docs/manual/${process.env.VERSION_LATEST}/:slug`,
93-
},
94-
{
95-
source: "/docs/manual/next/:slug",
96-
destination: `/docs/manual/${process.env.VERSION_NEXT}/:slug`,
97-
},
98-
],
99-
};
100-
},
10187
async redirects() {
10288
return [
10389
{
@@ -140,6 +126,16 @@ const config = {
140126
destination: "/docs/manual/latest/typescript-integration",
141127
permanent: true,
142128
},
129+
{
130+
source: "/docs/manual/latest/:slug*",
131+
destination: `/docs/manual/${process.env.VERSION_LATEST}/:slug*`,
132+
permanent: false,
133+
},
134+
{
135+
source: "/docs/manual/next/:slug*",
136+
destination: `/docs/manual/${process.env.VERSION_NEXT}/:slug*`,
137+
permanent: false,
138+
},
143139
];
144140
},
145141
};

public/_redirects

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@
88
/docs/gentype/latest/getting-started /docs/manual/latest/typescript-integration 308
99
/docs/gentype/latest/usage /docs/manual/latest/typescript-integration 308
1010
/docs/gentype/latest/supported-types /docs/manual/latest/typescript-integration 308
11+
12+
/docs/manual/latest/:slug* /docs/manual/v11.0.0/:slug* 307
13+
/docs/manual/next/:slug* /docs/manual/v12.0.0/:slug* 307

0 commit comments

Comments
 (0)