From c2946af9b1d5f1050ea993769b292a7941a22d5a Mon Sep 17 00:00:00 2001
From: Vladimir Khomenok <34284073+khomenok@users.noreply.github.com>
Date: Fri, 18 Oct 2024 19:20:02 +0200
Subject: [PATCH] Feat: Better Client Redirects (#35)
* feat: added client redirects
* feat: added client redirects
---
docs/docusaurus.config.ts | 26 ++++++++++++++++++++++----
docs/package.json | 1 +
docs/src/pages/data-sheets.tsx | 8 --------
docs/src/pages/getting-started.tsx | 8 --------
docs/yarn.lock | 15 +++++++++++++++
5 files changed, 38 insertions(+), 20 deletions(-)
delete mode 100644 docs/src/pages/data-sheets.tsx
delete mode 100644 docs/src/pages/getting-started.tsx
diff --git a/docs/docusaurus.config.ts b/docs/docusaurus.config.ts
index f448980..b6166cc 100644
--- a/docs/docusaurus.config.ts
+++ b/docs/docusaurus.config.ts
@@ -109,7 +109,7 @@ const config: Config = {
label: 'Timeline',
position: 'right'
},
-
+
// {to: '/blog', label: 'Blog', position: 'left'},
// {
// label: 'Website',
@@ -135,7 +135,7 @@ const config: Config = {
className: 'header-github-link',
'aria-label': 'GitHub repository'
},
-
+
],
},
footer: {
@@ -233,7 +233,7 @@ const config: Config = {
srcDark: 'img/logos/UptimeIndustries-logo-green.svg',
height: 100
},
-
+
},
prism: {
theme: prismThemes.github,
@@ -276,8 +276,26 @@ const config: Config = {
sidebar: {
autoCollapseCategories: false
}
- }
+ },
} satisfies Preset.ThemeConfig,
+
+ plugins: [
+ [
+ '@docusaurus/plugin-client-redirects',
+ {
+ redirects: [
+ {
+ to: '/datasheets/',
+ from: ['/data-sheets/'],
+ },
+ {
+ to: '/blade/getting-started/assembly/',
+ from: ['/getting-started/']
+ },
+ ],
+ },
+ ],
+ ]
};
export default config;
diff --git a/docs/package.json b/docs/package.json
index 7c015f0..be29354 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -16,6 +16,7 @@
},
"dependencies": {
"@docusaurus/core": "^3.5.2",
+ "@docusaurus/plugin-client-redirects": "^3.5.2",
"@docusaurus/preset-classic": "^3.5.2",
"@mdx-js/react": "^3.0.1",
"clsx": "^2.1.1",
diff --git a/docs/src/pages/data-sheets.tsx b/docs/src/pages/data-sheets.tsx
deleted file mode 100644
index 5bc4a29..0000000
--- a/docs/src/pages/data-sheets.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-import { Redirect } from '@docusaurus/router';
-import config from '../../docusaurus.config'
-function body() {
- const path = `${config.baseUrl}datasheets`
- return ;
-}
-
-export default body
\ No newline at end of file
diff --git a/docs/src/pages/getting-started.tsx b/docs/src/pages/getting-started.tsx
deleted file mode 100644
index 00984c2..0000000
--- a/docs/src/pages/getting-started.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-import { Redirect } from '@docusaurus/router';
-import config from '../../docusaurus.config'
-function body() {
- const path = `${config.baseUrl}blade/getting-started/assembly`
- return ;
-}
-
-export default body
\ No newline at end of file
diff --git a/docs/yarn.lock b/docs/yarn.lock
index a312013..d55e4ec 100644
--- a/docs/yarn.lock
+++ b/docs/yarn.lock
@@ -1360,6 +1360,21 @@
react-helmet-async "*"
react-loadable "npm:@docusaurus/react-loadable@6.0.0"
+"@docusaurus/plugin-client-redirects@^3.5.2":
+ version "3.5.2"
+ resolved "https://registry.yarnpkg.com/@docusaurus/plugin-client-redirects/-/plugin-client-redirects-3.5.2.tgz#ace1549e30cfca42dbc625f92920ea66a3cd7b1d"
+ integrity sha512-GMU0ZNoVG1DEsZlBbwLPdh0iwibrVZiRfmdppvX17SnByCVP74mb/Nne7Ss7ALgxQLtM4IHbXi8ij90VVjAJ+Q==
+ dependencies:
+ "@docusaurus/core" "3.5.2"
+ "@docusaurus/logger" "3.5.2"
+ "@docusaurus/utils" "3.5.2"
+ "@docusaurus/utils-common" "3.5.2"
+ "@docusaurus/utils-validation" "3.5.2"
+ eta "^2.2.0"
+ fs-extra "^11.1.1"
+ lodash "^4.17.21"
+ tslib "^2.6.0"
+
"@docusaurus/plugin-content-blog@3.5.2":
version "3.5.2"
resolved "https://registry.yarnpkg.com/@docusaurus/plugin-content-blog/-/plugin-content-blog-3.5.2.tgz#649c07c34da7603645f152bcebdf75285baed16b"