GeezerVison is showing github.com — feat: add index rediect · khoh12/lowcode-engine@3e485b0
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: docs/package.json +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | { |
2 | 2 | "name": "@alilc/lowcode-engine-docs", |
3 | | - "version": "0.0.1-beta.3", |
| 3 | + "version": "0.0.1-beta.4", |
4 | 4 | "description": "低代码引擎版本化文档", |
5 | 5 | "license": "MIT", |
6 | 6 | "files": [ |
|
Collapse file
Copy file name to clipboard +40Lines changed: 40 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +import React from 'react'; |
| 2 | +import clsx from 'clsx'; |
| 3 | +import Link from '@docusaurus/Link'; |
| 4 | +import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; |
| 5 | +import Layout from '@theme/Layout'; |
| 6 | + |
| 7 | +import styles from './index.module.css'; |
| 8 | + |
| 9 | +function HomepageHeader() { |
| 10 | + const { siteConfig } = useDocusaurusContext(); |
| 11 | + return ( |
| 12 | + <header className={clsx('hero hero--primary', styles.heroBanner)}> |
| 13 | + <div className="container"> |
| 14 | + <h1 className={styles.heroTitle}>{siteConfig.title}</h1> |
| 15 | + <h2>欢迎光临 低代码引擎文档站</h2> |
| 16 | + <p className="hero__subtitle">{siteConfig.tagline}</p> |
| 17 | + <div className={styles.buttons}> |
| 18 | + <Link |
| 19 | + className="button button--secondary button--lg" |
| 20 | + to="/docs/guide/quickStart/start" |
| 21 | + > |
| 22 | + 快速开始 |
| 23 | + </Link> |
| 24 | + </div> |
| 25 | + </div> |
| 26 | + </header> |
| 27 | + ); |
| 28 | +} |
| 29 | + |
| 30 | +export default function Home(): JSX.Element { |
| 31 | + const { siteConfig } = useDocusaurusContext(); |
| 32 | + return ( |
| 33 | + <Layout |
| 34 | + title={`${siteConfig.title}`} |
| 35 | + description="" |
| 36 | + > |
| 37 | + <HomepageHeader /> |
| 38 | + </Layout> |
| 39 | + ); |
| 40 | +} |
Collapse file
Copy file name to clipboard +11-35Lines changed: 11 additions & 35 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import React from 'react'; |
2 | | -import clsx from 'clsx'; |
3 | | -import Link from '@docusaurus/Link'; |
4 | | -import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; |
5 | | -import Layout from '@theme/Layout'; |
| 2 | +import BrowserOnly from '@docusaurus/BrowserOnly'; |
6 | 3 |
|
7 | | -import styles from './index.module.css'; |
8 | | - |
9 | | -function HomepageHeader() { |
10 | | - const { siteConfig } = useDocusaurusContext(); |
11 | | - return ( |
12 | | - <header className={clsx('hero hero--primary', styles.heroBanner)}> |
13 | | - <div className="container"> |
14 | | - <h1 className={styles.heroTitle}>{siteConfig.title}</h1> |
15 | | - <h2>欢迎光临 低代码引擎文档站</h2> |
16 | | - <p className="hero__subtitle">{siteConfig.tagline}</p> |
17 | | - <div className={styles.buttons}> |
18 | | - <Link |
19 | | - className="button button--secondary button--lg" |
20 | | - to="/docs/guide/quickStart/start" |
21 | | - > |
22 | | - 快速开始 |
23 | | - </Link> |
24 | | - </div> |
25 | | - </div> |
26 | | - </header> |
27 | | - ); |
28 | | -} |
29 | | - |
30 | | -export default function Home(): JSX.Element { |
31 | | - const { siteConfig } = useDocusaurusContext(); |
| 4 | +export default function ToIndex(): JSX.Element { |
32 | 5 | return ( |
33 | | - <Layout |
34 | | - title={`${siteConfig.title}`} |
35 | | - description="" |
36 | | - > |
37 | | - <HomepageHeader /> |
38 | | - </Layout> |
| 6 | + <BrowserOnly> |
| 7 | + {() => { |
| 8 | + /** |
| 9 | + * 跳转到首页 |
| 10 | + */ |
| 11 | + window.location.href = '/index'; |
| 12 | + return <></>; |
| 13 | + }} |
| 14 | + </BrowserOnly> |
39 | 15 | ); |
40 | 16 | } |