diff --git a/docusaurus.config.js b/docusaurus.config.js index 28b43567abd..81c8674c902 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -34,7 +34,8 @@ const config = { sidebarPath: require.resolve("./sidebars.js"), // Set a base path separate from default /docs editUrl: "https://github.com/hyperledger/besu-docs/tree/main/", - // path: "docs", + path: "./docs", + includeCurrentVersion: true, lastVersion: "23.4.1", versions: { //defaults to the ./docs folder @@ -42,19 +43,13 @@ const config = { current: { label: "development", path: "development", - banner: "unreleased", }, //the last stable release in the versioned_docs/version-stable - // using 'stable' as path "23.4.1": { label: "stable (23.4.1)", - path: "stable", - banner: "none", }, "23.4.0": { label: "23.4.0", - path: "23.4.0", - banner: "unmaintained", }, }, routeBasePath: "/", @@ -70,7 +65,6 @@ const config = { ], showLastUpdateAuthor: false, showLastUpdateTime: true, - includeCurrentVersion: true, }, theme: { customCss: require.resolve("./src/css/custom.css"), @@ -278,34 +272,6 @@ const config = { containerId: "GTM-THG37T4", }, ], - [ - "@docusaurus/plugin-client-redirects", - { - redirects: [ - { - from: "/en/latest", - to: "/", - }, - { - from: "/en/stable", - to: "/", - }, - ], - createRedirects(existingPath) { - if (existingPath.includes("/development")) { - return [ - existingPath.replace("/development", "/en/development"), - existingPath.replace("/development", "/en/latest"), - existingPath.replace("/development", "/latest"), - ]; - } - if (existingPath.includes("/stable")) { - return [existingPath.replace("/stable", "/en/stable")]; - } - return undefined; // Return a falsy value: no redirect created - }, - }, - ], ], themes: [ [ diff --git a/package.json b/package.json index 07b6be738b5..7d5610bd23e 100644 --- a/package.json +++ b/package.json @@ -14,18 +14,18 @@ "write-heading-ids": "docusaurus write-heading-ids", "typecheck": "tsc", "typecheck-staged": "tsc-files --noEmit", - "lint": "npm run lint:spelling && npm run lint:js && npm run lint:style", + "lint": "yarn run lint:spelling && yarn run lint:js && yarn run lint:style", "lint:js": "eslint . --ext js,jsx,ts,tsx --max-warnings=0", "lint:spelling": "cspell \"**\" --no-progress", "lint:style": "stylelint \"**/*.css\"", - "lint:fix": "npm run lint:js -- --fix", + "lint:fix": "yarn run lint:js -- --fix", "format": "prettier --write '{blog,docs,src,static}/**/*.{md,mdx,ts,js,tsx,jsx,json}'" }, "lint-staged": { - "**/*.{ts,tsx}": "npm run typecheck-staged", - "**/*.css": "npm run lint:style", - "**/*.{md,mdx}": "npm run lint:spelling", - "**/*.{md,mdx,ts,js,tsx,jsx,json}": "npm run format" + "**/*.{ts,tsx}": "yarn run typecheck-staged", + "**/*.css": "yarn run lint:style", + "**/*.{md,mdx}": "yarn run lint:spelling", + "**/*.{md,mdx,ts,js,tsx,jsx,json}": "yarn run format" }, "dependencies": { "@docusaurus/core": "^2.4.1", diff --git a/vercel.json b/vercel.json new file mode 100644 index 00000000000..e372ebdf587 --- /dev/null +++ b/vercel.json @@ -0,0 +1,19 @@ +{ + "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 + } + ] +} diff --git a/yarn.lock b/yarn.lock index 0fe50d79a21..ca4e54fac9d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13837,4 +13837,4 @@ yocto-queue@^1.0.0: zwitch@^1.0.0: version "1.0.5" resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-1.0.5.tgz#d11d7381ffed16b742f6af7b3f223d5cd9fe9920" - integrity sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw== + integrity sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw== \ No newline at end of file