From 3e485b07dae2dd6f440fcdeea6f1a5e9ee9a62c0 Mon Sep 17 00:00:00 2001 From: "xiaoxian.xlf" Date: Mon, 28 Nov 2022 16:05:36 +0800 Subject: [PATCH] feat: add index rediect --- docs/package.json | 2 +- docs/src/pages/index-old.tsx | 40 +++++++++++++++++++++++++++++++ docs/src/pages/index.tsx | 46 +++++++++--------------------------- 3 files changed, 52 insertions(+), 36 deletions(-) create mode 100644 docs/src/pages/index-old.tsx diff --git a/docs/package.json b/docs/package.json index 306b58cac..8bbab34d8 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,6 +1,6 @@ { "name": "@alilc/lowcode-engine-docs", - "version": "0.0.1-beta.3", + "version": "0.0.1-beta.4", "description": "低代码引擎版本化文档", "license": "MIT", "files": [ diff --git a/docs/src/pages/index-old.tsx b/docs/src/pages/index-old.tsx new file mode 100644 index 000000000..13be38e6e --- /dev/null +++ b/docs/src/pages/index-old.tsx @@ -0,0 +1,40 @@ +import React from 'react'; +import clsx from 'clsx'; +import Link from '@docusaurus/Link'; +import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; +import Layout from '@theme/Layout'; + +import styles from './index.module.css'; + +function HomepageHeader() { + const { siteConfig } = useDocusaurusContext(); + return ( +
+
+

{siteConfig.title}

+

欢迎光临 低代码引擎文档站

+

{siteConfig.tagline}

+
+ + 快速开始 + +
+
+
+ ); +} + +export default function Home(): JSX.Element { + const { siteConfig } = useDocusaurusContext(); + return ( + + + + ); +} diff --git a/docs/src/pages/index.tsx b/docs/src/pages/index.tsx index 13be38e6e..cdf826a64 100644 --- a/docs/src/pages/index.tsx +++ b/docs/src/pages/index.tsx @@ -1,40 +1,16 @@ import React from 'react'; -import clsx from 'clsx'; -import Link from '@docusaurus/Link'; -import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; -import Layout from '@theme/Layout'; +import BrowserOnly from '@docusaurus/BrowserOnly'; -import styles from './index.module.css'; - -function HomepageHeader() { - const { siteConfig } = useDocusaurusContext(); +export default function ToIndex(): JSX.Element { return ( -
-
-

{siteConfig.title}

-

欢迎光临 低代码引擎文档站

-

{siteConfig.tagline}

-
- - 快速开始 - -
-
-
- ); -} - -export default function Home(): JSX.Element { - const { siteConfig } = useDocusaurusContext(); - return ( - - - + + {() => { + /** + * 跳转到首页 + */ + window.location.href = '/index'; + return <>; + }} + ); }