Skip to content

Commit 68ad42e

Browse files
committed
docs: add redirect to Overview when page not found and rename start to Overview
1 parent dccce56 commit 68ad42e

8 files changed

Lines changed: 34 additions & 10 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
title: Overview
3+
---
4+
15
<div align="center">
26

37
<img src="https://img.alicdn.com/imgextra/i2/O1CN01R6uYoU1VrrET7d1G6_!!6000000002707-0-tps-1292-407.jpg" width="40%" alt="ROLL Logo" />

docs_roll/i18n/zh-Hans/docusaurus-plugin-content-docs/current.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@
7171
"message": "开发者指南",
7272
"description": "The label for category 'Developer Guide' in sidebar 'tutorialSidebar'"
7373
}
74-
}
74+
}

docs_roll/i18n/zh-Hans/docusaurus-plugin-content-docs/current/Overview/start.mdx renamed to docs_roll/i18n/zh-Hans/docusaurus-plugin-content-docs/current/Overview.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
title: 概览
3+
---
4+
15
<div align="center">
26

37
<img src="https://img.alicdn.com/imgextra/i2/O1CN01R6uYoU1VrrET7d1G6_!!6000000002707-0-tps-1292-407.jpg" width="40%" alt="ROLL Logo" />

docs_roll/sidebars.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,7 @@
1515
const sidebars = {
1616
// By default, Docusaurus generates a sidebar from the docs folder structure
1717
tutorialSidebar: [
18-
{
19-
type: 'category',
20-
label: 'Overview',
21-
items: [
22-
{ type: 'autogenerated', dirName: 'Overview' }, // 按文件名排序
23-
],
24-
},
18+
'Overview',
2519
{
2620
type: 'category',
2721
label: 'Getting Started',

docs_roll/src/components/HomeContent/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default () => {
4545
</Translate>
4646
</div>
4747
<div className={styles.buttons}>
48-
<Button href={`${targetPath}docs/Overview/start`} target='_blank' className={styles.btn}>
48+
<Button href={`${targetPath}docs/Overview`} target='_blank' className={styles.btn}>
4949
<Translate>{"Get Started >"}</Translate>
5050
</Button>
5151
<Button className={styles.github} target='_blank' href="https://github.com/alibaba/ROLL" variant="outlined" icon={<GithubOutlined />}>{"Github >"}</Button>

docs_roll/src/theme/Navbar/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default function Navbar() {
5555
<Button className={clsx(styles.btn, isHomePage && location.hash === '#research' ? styles.primary : '')} href={`${targetPath}#research`} type="text">
5656
<Translate>Research Community</Translate>
5757
</Button>
58-
<Button className={clsx(styles.btn, !isHomePage ? styles.primary : '')} type="text" href={`${targetPath}docs/Overview/start`}>
58+
<Button className={clsx(styles.btn, !isHomePage ? styles.primary : '')} type="text" href={`${targetPath}docs/Overview`}>
5959
<Translate>API Docs</Translate>
6060
</Button>
6161
<Button className={styles.btn} href='https://github.com/alibaba/ROLL' type="text">Github<ExportOutlined /></Button>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React from 'react';
2+
import { Redirect } from '@docusaurus/router';
3+
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
4+
5+
export default function NotFoundContent() {
6+
const { i18n } = useDocusaurusContext();
7+
const { currentLocale } = i18n;
8+
const isChinese = currentLocale !== 'en';
9+
10+
return <Redirect to={`/ROLL/${isChinese ? 'zh-Hans/' : ''}docs/Overview`} />;
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React from 'react';
2+
import { Redirect } from '@docusaurus/router';
3+
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
4+
5+
export default function Index() {
6+
const { i18n } = useDocusaurusContext();
7+
const { currentLocale } = i18n;
8+
const isChinese = currentLocale !== 'en';
9+
10+
return <Redirect to={`/ROLL/${isChinese ? 'zh-Hans/' : ''}docs/Overview`} />;
11+
}

0 commit comments

Comments
 (0)