Skip to content

Commit 3e485b0

Browse files
author
xiaoxian.xlf
committed
feat: add index rediect
1 parent 260e179 commit 3e485b0

3 files changed

Lines changed: 52 additions & 36 deletions

File tree

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@alilc/lowcode-engine-docs",
3-
"version": "0.0.1-beta.3",
3+
"version": "0.0.1-beta.4",
44
"description": "低代码引擎版本化文档",
55
"license": "MIT",
66
"files": [

docs/src/pages/index-old.tsx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
}

docs/src/pages/index.tsx

Lines changed: 11 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,16 @@
11
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';
63

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 {
325
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>
3915
);
4016
}

0 commit comments

Comments
 (0)