Skip to content

Commit

Permalink
test redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
nialexsan committed Oct 26, 2023
1 parent 989dbc7 commit 2b3f951
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
28 changes: 23 additions & 5 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,11 @@ const config = {
},
...(process.env.GA_TRACKING_ID
? {
gtag: {
trackingID: process.env.GA_TRACKING_ID,
anonymizeIP: true,
},
}
gtag: {
trackingID: process.env.GA_TRACKING_ID,
anonymizeIP: true,
},
}
: {}),
}),
],
Expand Down Expand Up @@ -580,6 +580,24 @@ const config = {
};
},
// require('./plugins/networks')
[
'@docusaurus/plugin-client-redirects',
{
createRedirects(existingPath) {
console.log({ existingPath });
if (existingPath.includes('/cadence')) {
// Redirect from /docs/team/X to /community/X and /docs/support/X to /community/X
return [
existingPath.replace(
'https://cadence-lang-docs-git-fix-links-versions-onflow.vercel.app/docs/0.42/',
'/cadence',
),
];
}
return undefined; // Return a falsy value: no redirect created
},
},
],
],
stylesheets: [
{
Expand Down
2 changes: 1 addition & 1 deletion vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@
},
{
"source": "/cadence/:path*",
"destination": "https://cadence-lang.org/:path*",
"destination": "https://cadence-lang-docs-git-fix-links-versions-onflow.vercel.app/docs/0.42/:path*",
"permanent": true
}
]
Expand Down

0 comments on commit 2b3f951

Please sign in to comment.