Skip to content

Commit 99f9fcf

Browse files
authored
chore: review links (#1034)
* chore: remove databend.rs redirect * fix: format * chore: remove redirects * remove useless * fix: erro links
1 parent 6f15c51 commit 99f9fcf

File tree

2 files changed

+25
-20
lines changed

2 files changed

+25
-20
lines changed

docusaurus.config.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -201,26 +201,6 @@ const config: Config = {
201201
},
202202
},
203203
},
204-
],
205-
[
206-
'@docusaurus/plugin-client-redirects',
207-
{
208-
redirects: [
209-
{ to: '/doc/sql-reference', from: '/sql/sql-reference' },
210-
{ to: '/doc/sql-functions', from: '/sql/sql-functions' },
211-
{ to: '/doc/sql-commands', from: '/sql/sql-commands' },
212-
{ to: '/doc/develop', from: '/developer/drivers' },
213-
{ to: '/doc/deploy', from: '/guides/deploy' },
214-
{ to: '/doc/cloud', from: '/guides/cloud' },
215-
{ to: '/cloud/develop', from: '/developer/drivers' },
216-
{ to: '/doc/sql-clients', from: '/guides/sql-clients' },
217-
{ to: '/doc/load-data', from: '/guides/load-data' },
218-
{ to: '/doc/visualize', from: '/guides/visualize' },
219-
{ to: '/doc/monitor', from: '/guides/monitor' },
220-
{ to: '/doc/overview', from: '/guides/overview' },
221-
{ to: '/cloud/getting-started/new-account', from: '/guides/cloud/new-account' },
222-
]
223-
}
224204
]
225205
],
226206
themes: ['@docusaurus/theme-mermaid'],

src/theme/NotFound/404.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,34 @@
11
import React from "react";
22
import { translate } from "@docusaurus/Translate";
33
import Layout from "@theme/Layout";
4+
import { useMount } from "ahooks";
5+
import ExecutionEnvironment from "@docusaurus/ExecutionEnvironment";
46
import Content from "./Content";
57

68
export default function NotFound404() {
9+
const pathname = ExecutionEnvironment.canUseDOM ? window?.location?.href : "";
10+
const redirectsMap = {
11+
"/doc/sql-reference": "/sql/sql-reference",
12+
"/doc/sql-commands": "/sql/sql-commands",
13+
"/doc/sql-functions": "/sql/sql-functions",
14+
"/doc/develop": "/developer/drivers",
15+
"/doc/deploy": "/guides/deploy",
16+
"/doc/cloud": "/guides/cloud",
17+
"/cloud/develop": "/developer/drivers",
18+
"/doc/sql-clients": "/guides/sql-clients",
19+
"/doc/load-data": "/guides/load-data",
20+
"/doc/visualize": "/guides/visualize",
21+
"/doc/monitor": "/guides/monitor",
22+
"/doc/overview": "/guides/overview",
23+
"/cloud/getting-started/new-account": "/guides/cloud/new-account",
24+
};
25+
useMount(() => {
26+
for (const [oldPath, newPath] of Object.entries(redirectsMap)) {
27+
if (pathname?.includes(oldPath)) {
28+
window.open(pathname.replace(oldPath, newPath), "_self");
29+
}
30+
}
31+
});
732
return (
833
<Layout
934
title={translate({

0 commit comments

Comments
 (0)