Skip to content

Commit

Permalink
update routing paths
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Fernandes <joshua.fernandes@consensys.net>
  • Loading branch information
joshuafernandes committed Aug 2, 2023
1 parent c23bd2c commit 8e6a6e2
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 43 deletions.
38 changes: 2 additions & 36 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,22 @@ 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
// using 'development' instead of 'next' as path
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: "/",
Expand All @@ -70,7 +65,6 @@ const config = {
],
showLastUpdateAuthor: false,
showLastUpdateTime: true,
includeCurrentVersion: true,
},
theme: {
customCss: require.resolve("./src/css/custom.css"),
Expand Down Expand Up @@ -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: [
[
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
19 changes: 19 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -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
}
]
}
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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==

0 comments on commit 8e6a6e2

Please sign in to comment.