Skip to content

Commit 8a5def9

Browse files
committed
docs: optimize home page
1 parent 2ff899b commit 8a5def9

File tree

7 files changed

+51
-15
lines changed

7 files changed

+51
-15
lines changed

docs/docs/en/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ hero:
55
name: MateChat React
66
text: AI scenario solution
77
tagline: A frontend AI scenario solution UI library based on DevUI Design
8-
# actions:
9-
# - theme: brand
10-
# text: Quick Start
11-
# link: /guide/start/introduction
12-
# - theme: alt
13-
# text: GitHub
14-
# link: https://github.com/DevCloudFE/matechat-react
8+
actions:
9+
# - theme: brand
10+
# text: Quick Start
11+
# link: /guide/start/introduction
12+
- theme: alt
13+
text: GitHub
14+
link: https://github.com/DevCloudFE/matechat-react
1515
image:
1616
src: /matechat-icon.svg
1717

docs/env.d.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/rspress.config.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as path from "node:path";
1+
import path from "node:path";
22
import { pluginPlayground } from "@rspress/plugin-playground";
33
import { defineConfig } from "rspress/config";
44
import GitCodeIcon from "./assets/gitcode.ts";
@@ -9,6 +9,10 @@ export default defineConfig({
99
title: "MateChat React",
1010
icon: "/matechat-icon.svg",
1111
logo: "/matechat-icon.svg",
12+
logoText: "MateChat React",
13+
markdown: {
14+
checkDeadLinks: true,
15+
},
1216
lang: "en",
1317
locales: [
1418
{
@@ -39,6 +43,10 @@ export default defineConfig({
3943
content: "https://github.com/DevCloudFE/matechat-react",
4044
},
4145
],
46+
hideNavbar: "auto",
47+
footer: {
48+
message: "MIT Licensed | © 2025 DevCloudFE. All Rights Reserved.",
49+
},
4250
},
4351
globalStyles: path.resolve(__dirname, "./docs/tailwind.css"),
4452
mediumZoom: {

docs/theme/index.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { useLang } from "rspress/runtime";
2+
import {
3+
HomeLayout as BasicHomeLayout,
4+
Layout as BasicLayout,
5+
// getCustomMDXComponent,
6+
} from "rspress/theme";
7+
8+
function HomeLayout() {
9+
// const { code: Code } = getCustomMDXComponent();
10+
return <BasicHomeLayout />;
11+
}
12+
13+
const Layout = () => {
14+
const lang = useLang();
15+
return (
16+
<BasicLayout
17+
beforeNav={
18+
<div className="text-center from-sky-400 to-emerald-600 bg-gradient-to-r text-white font-bold py-1">
19+
{lang === "en"
20+
? "🚧 MateChat React document is still under development"
21+
: "🚧 MateChat React 文档仍在开发中"}
22+
</div>
23+
}
24+
/>
25+
);
26+
};
27+
28+
export default { HomeLayout, Layout };
29+
export * from "rspress/theme";

docs/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"useDefineForClassFields": true,
1414
"allowImportingTsExtensions": true
1515
},
16-
"include": ["docs", "theme", "rspress.config.ts", "env.d.ts"],
16+
"include": ["docs", "theme", "rspress.config.ts"],
1717
"mdx": {
1818
"checkMdx": true
1919
}

scripts/docs-watch.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { execSync, spawn } from "node:child_process";
2-
import fs, { type WatchEventType } from "node:fs";
2+
import fs from "node:fs";
33
import path from "node:path";
44
import { createSpinner } from "archons";
55
import chalk from "chalk";
@@ -80,7 +80,7 @@ function watchAndServe() {
8080

8181
let lastBuildTime = Date.now();
8282

83-
fs.watch(srcDir, { recursive: true }, (eventType, filename) => {
83+
fs.watch(srcDir, { recursive: true }, (_eventType, filename) => {
8484
if (!filename || isIgnoredFile(filename)) return;
8585
if (Date.now() - lastBuildTime < 1000) return;
8686

scripts/sync-changelog.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import fs from "fs";
2-
import path from "path";
3-
import { fileURLToPath } from "url";
1+
import fs from "node:fs";
2+
import path from "node:path";
3+
import { fileURLToPath } from "node:url";
44

55
const __filename = fileURLToPath(import.meta.url);
66
const __dirname = path.dirname(__filename);

0 commit comments

Comments
 (0)