11import React from "react" ;
2- import { useMount } from "ahooks" ;
32import NotFoundSvg from "./no-found.svg" ;
43import clsx from "clsx" ;
54import $t from "@site/src/utils/tools" ;
65import styles from "./not-found.module.scss" ;
7- import { Button , Spin , Space } from "antd" ;
8- import ExecutionEnvironment from "@docusaurus/ExecutionEnvironment" ;
6+ import { Button , Space } from "antd" ;
97import useDocusaurusContext from "@docusaurus/useDocusaurusContext" ;
108
119export default function Content ( ) {
@@ -14,29 +12,6 @@ export default function Content() {
1412 customFields : { homeLink } ,
1513 } ,
1614 } = useDocusaurusContext ( ) ;
17- const pathname = ExecutionEnvironment . canUseDOM ? window ?. location ?. href : "" ;
18- const redirectsMap = {
19- "/doc/sql-reference" : "/sql/sql-reference" ,
20- "/doc/sql-commands" : "/sql/sql-commands" ,
21- "/doc/sql-functions" : "/sql/sql-functions" ,
22- "/doc/develop" : "/developer/drivers" ,
23- "/doc/deploy" : "/guides/deploy" ,
24- "/doc/cloud" : "/guides/cloud" ,
25- "/cloud/develop" : "/developer/drivers" ,
26- "/doc/sql-clients" : "/guides/sql-clients" ,
27- "/doc/load-data" : "/guides/load-data" ,
28- "/doc/visualize" : "/guides/visualize" ,
29- "/doc/monitor" : "/guides/monitor" ,
30- "/doc/overview" : "/guides/overview" ,
31- "/cloud/getting-started/new-account" : "/guides/cloud/new-account" ,
32- } ;
33- useMount ( ( ) => {
34- for ( const [ oldPath , newPath ] of Object . entries ( redirectsMap ) ) {
35- if ( pathname ?. includes ( oldPath ) ) {
36- window . open ( pathname . replace ( oldPath , newPath ) , "_self" ) ;
37- }
38- }
39- } ) ;
4015 return (
4116 < div
4217 className = { clsx ( "g-align-c global-container-width" , styles . rowContainer ) }
@@ -46,12 +21,6 @@ export default function Content() {
4621 < div className = { styles . notFoundTitle } > { $t ( "PAGE NOT FOUND" ) } </ div >
4722 < div className = "fontSize20" >
4823 { $t ( "Please check your link or head Home to regroup." ) }
49- { Object . keys ( redirectsMap ) . find ( ( key ) => pathname . includes ( key ) ) && (
50- < span >
51- { " " }
52- { $t ( "Redirecting to a new link" ) } < Spin > </ Spin >
53- </ span >
54- ) }
5524 </ div >
5625 < Space size = { 16 } >
5726 < Button type = "primary" href = "/guides" >
0 commit comments