diff --git a/docusaurus.config.ts b/docusaurus.config.ts index ed90d60a..caaa5804 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -28,7 +28,28 @@ const config: Config = { locales: ['en'], }, - plugins: [['docusaurus-node-polyfills', { excludeAliases: ['console'] }]], + plugins: [ + ['docusaurus-node-polyfills', { excludeAliases: ['console'] }], + [ + '@docusaurus/plugin-client-redirects', + { + redirects: [ + { + to: '/cardano-testnets/tools/faucet', + from: '/cardano-testnet/tools/faucet', + }, + ], + createRedirects(existingPath) { + if (existingPath.includes('/cardano-testnet')) { + return [ + existingPath.replace('/cardano-testnet', '/cardano-testnets'), + ] + } + return undefined // Return a falsy value: no redirect created + }, + }, + ], + ], presets: [ [ @@ -39,7 +60,8 @@ const config: Config = { routeBasePath: '/', // Please change this to your repo. // Remove this to remove the "edit this page" links. - editUrl: 'https://github.com/input-output-hk/cardano-documentation', + editUrl: + 'https://github.com/input-output-hk/cardano-documentation/blob/master/', }, // blog: { // showReadingTime: true, diff --git a/package.json b/package.json index 560be286..9dd79870 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "dependencies": { "@ctrl/tinycolor": "^4.0.3", "@docusaurus/core": "3.1.1", + "@docusaurus/plugin-client-redirects": "3.1.1", "@docusaurus/preset-classic": "3.1.1", "@emotion/core": "^10.0.22", "@emotion/react": "^11.9.3", @@ -33,6 +34,7 @@ "@mui/material": "^5.9.2", "clsx": "^2.0.0", "dayjs": "^1.11.9", + "docusaurus-node-polyfills": "^1.0.0", "emotion": "^10.0.23", "emotion-server": "^10.0.17", "emotion-theming": "^10.0.19", @@ -47,13 +49,12 @@ "react": "^18.0.0", "react-dom": "^18.0.0", "react-google-recaptcha": "^3.1.0", + "react-hook-form": "^7.51.0", "react-icons": "^5.0.1", + "react-tooltip": "^4.2.21", "styled-components": "^4.4.1", "styled-icons": "^9.0.1", - "victory": "^36.5.3", - "docusaurus-node-polyfills": "^1.0.0", - "react-tooltip": "^4.2.21", - "react-hook-form": "^7.51.0" + "victory": "^36.5.3" }, "devDependencies": { "@docusaurus/module-type-aliases": "3.1.1", diff --git a/yarn.lock b/yarn.lock index 18e1e97a..0259f718 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1397,6 +1397,21 @@ react-helmet-async "*" react-loadable "npm:@docusaurus/react-loadable@5.5.2" +"@docusaurus/plugin-client-redirects@3.1.1": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@docusaurus/plugin-client-redirects/-/plugin-client-redirects-3.1.1.tgz#73feb15c2f3fe292d618f8a81e5194142f982ddb" + integrity sha512-J/1Z75XkO+BmUXHW17FrCIYZQ3b0IKaJECH6yCxW5RQ8NMMJ+SZCtPtx5oYoAd0VHersNiUu+ZAxfOqbsn1jKQ== + dependencies: + "@docusaurus/core" "3.1.1" + "@docusaurus/logger" "3.1.1" + "@docusaurus/utils" "3.1.1" + "@docusaurus/utils-common" "3.1.1" + "@docusaurus/utils-validation" "3.1.1" + eta "^2.2.0" + fs-extra "^11.1.1" + lodash "^4.17.21" + tslib "^2.6.0" + "@docusaurus/plugin-content-blog@3.1.1": version "3.1.1" resolved "https://registry.yarnpkg.com/@docusaurus/plugin-content-blog/-/plugin-content-blog-3.1.1.tgz#16f4fd723227b2158461bba6b9bcc18c1926f7ea"