diff --git a/docusaurus.config.js b/docusaurus.config.js index 48a9180a192..1a4c41a2f1e 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -288,6 +288,14 @@ const config = { "@docusaurus/plugin-client-redirects", { redirects: [ + { + from: ["/en/latest", "/en/development", "/latest", "/development"], + to: "/development/public-networks", + }, + { + from: "/public-networks/how-to/configuration-file", + to: "/public-networks/how-to/use-configuration-file", + }, { from: "/private-networks/tutorials/permissioning/onchain", to: "/private-networks/how-to/use-permissioning/onchain", @@ -296,13 +304,23 @@ const config = { from: "/private-networks/tutorials/permissioning/upgrade-contracts", to: "/private-networks/how-to/use-permissioning/onchain", }, - /* - { - from: "/public-networks/how-to/configuration-file", - to: "/public-networks/how-to/use-configuration-file", - }, - */ ], + createRedirects(existingPath) { + if (existingPath.includes("/development")) { + return [ + existingPath.replace("/development", "/en/development"), + existingPath.replace("/development", "/en/latest"), + existingPath.replace("/development", "/latest"), + ]; + } + if (existingPath.includes("/")) { + return [ + existingPath.replace("/", "/en/stable"), + existingPath.replace("/", "/stable"), + ]; + } + return undefined; // Return a falsy value: no redirect created + }, }, ], ], diff --git a/vercel.json b/vercel.json deleted file mode 100644 index e372ebdf587..00000000000 --- a/vercel.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "cleanUrls": true, - "redirects": [ - { "source": "/en/latest", "destination": "/development", "permanent": true }, - { "source": "/en/latest/", "destination": "/development", "permanent": true }, - { - "source": "/en/latest/:match(.*)", - "destination": "/development/:match(.*)", - "permanent": true - }, - { "source": "/en/stable", "destination": "/", "permanent": true }, - { "source": "/en/stable/", "destination": "/", "permanent": true }, - { - "source": "/en/stable/:match(.*)", - "destination": "/:match(.*)", - "permanent": true - } - ] -}