Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update routing paths #1368

Merged
merged 3 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 12 additions & 46 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 @@ -164,23 +158,23 @@ const config = {
items: [
{
label: "Introduction",
to: "/stable/public-networks",
to: "/public-networks",
},
{
label: "How to guides",
to: "/stable/public-networks/how-to",
to: "/public-networks/how-to",
},
{
label: "Concepts",
to: "/stable/public-networks/concepts",
to: "/public-networks/concepts",
},
{
label: "Tutorials",
to: "/stable/public-networks/tutorials",
to: "/public-networks/tutorials",
},
{
label: "Reference",
to: "/stable/public-networks/reference",
to: "/public-networks/reference",
},
],
},
Expand All @@ -189,23 +183,23 @@ const config = {
items: [
{
label: "Introduction",
to: "/stable/private-networks",
to: "/private-networks",
},
{
label: "How to guides",
to: "/stable/private-networks/how-to",
to: "/private-networks/how-to",
},
{
label: "Concepts",
to: "/stable/private-networks/concepts",
to: "/private-networks/concepts",
},
{
label: "Tutorials",
to: "/stable/private-networks/tutorials",
to: "/private-networks/tutorials",
},
{
label: "Reference",
to: "/stable/private-networks/reference",
to: "/private-networks/reference",
},
],
},
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",
joshuafernandes marked this conversation as resolved.
Show resolved Hide resolved
"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
4 changes: 2 additions & 2 deletions src/components/HomepageCards/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type CardItem = {
const CardList: CardItem[] = [
{
title: "🌐 Public networks",
link: "/stable/public-networks",
link: "/public-networks",
// prettier-ignore
description: (
<>
Expand All @@ -33,7 +33,7 @@ const CardList: CardItem[] = [
},
{
title: "🔐 Private networks",
link: "/stable/private-networks",
link: "/private-networks",
// prettier-ignore
description: (
<>
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==