Skip to content

Commit 359e253

Browse files
committed
Polish docs site homepage and localization
1 parent ddc361c commit 359e253

File tree

9 files changed

+307
-67
lines changed

9 files changed

+307
-67
lines changed

README.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
# Matrix Docs
22

3-
`D:\Matrix\Docs` 是 Matrix 系列插件的统一 Docusaurus 文档站。
3+
`54895y.github.io` 是 Matrix 系列插件的统一 Docusaurus 文档站。
44

55
当前已收录:
66

77
- MatrixAuth
8+
- MatrixCook
89
- MatrixShop
910

1011
## 当前结构
1112

1213
- `docs/plugins.mdx`:插件列表
1314
- `docs/intro.md`:站点总览
1415
- `docs/matrixauth/`:MatrixAuth 文档
16+
- `docs/matrixcook/`:MatrixCook 文档
1517
- `docs/matrixshop/`:MatrixShop 文档
1618
- `src/pages/index.tsx`:首页
19+
- `src/pages/ai-search.js`:AI 搜索页
1720
- `docusaurus.config.ts`:站点配置
1821
- `sidebars.ts`:侧边导航
1922

@@ -29,17 +32,31 @@
2932
- `baseUrl = /`
3033
- `deploymentBranch = main`
3134

35+
## 环境要求
36+
37+
- `Node.js >= 20`
38+
- `npm >= 10`
39+
3240
## 本地开发
3341

34-
```powershell
35-
cd D:\Matrix\Docs
42+
```bash
43+
cd /www/codex-work/54895y.github.io
3644
npm install
3745
npm start
3846
```
3947

4048
## 构建
4149

42-
```powershell
43-
cd D:\Matrix\Docs
50+
```bash
51+
cd /www/codex-work/54895y.github.io
52+
npm run build
53+
```
54+
55+
## 常用命令
56+
57+
```bash
58+
npm run start
4459
npm run build
60+
npm run serve
61+
npm run typecheck
4562
```

docusaurus.config.ts

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ const config: Config = {
3434
docs: {
3535
sidebarPath: './sidebars.ts',
3636
editUrl: 'https://github.com/54895y/54895y.github.io/tree/main/',
37+
showLastUpdateAuthor: true,
38+
showLastUpdateTime: true,
3739
exclude: ['**/tutorial-basics/**', '**/tutorial-extras/**'],
3840
},
3941
blog: false,
@@ -64,11 +66,30 @@ const config: Config = {
6466
],
6567
themeConfig: {
6668
image: 'img/logo.svg',
69+
metadata: [
70+
{
71+
name: 'description',
72+
content: 'MatrixAuth、MatrixCook、MatrixShop 官方文档,包含插件索引、本地搜索与 AI 搜索入口。',
73+
},
74+
{
75+
name: 'keywords',
76+
content: 'MatrixAuth, MatrixCook, MatrixShop, Minecraft, Paper, Bukkit, 插件文档',
77+
},
78+
{
79+
property: 'og:description',
80+
content: 'Matrix 系列插件官方文档站点,覆盖概览、安装、配置、命令与常见问题。',
81+
},
82+
],
6783
colorMode: {
6884
defaultMode: 'light',
6985
disableSwitch: false,
7086
respectPrefersColorScheme: true,
7187
},
88+
docs: {
89+
sidebar: {
90+
hideable: true,
91+
},
92+
},
7293
navbar: {
7394
title: 'Matrix Wiki',
7495
logo: {
@@ -80,9 +101,8 @@ const config: Config = {
80101
type: 'docSidebar',
81102
sidebarId: 'docsSidebar',
82103
position: 'left',
83-
label: 'Docs',
104+
label: '文档目录',
84105
},
85-
{to: '/docs/plugins', label: 'Plugins', position: 'left'},
86106
{to: '/docs/matrixauth/overview', label: 'MatrixAuth', position: 'left'},
87107
{to: '/docs/matrixcook/overview', label: 'MatrixCook', position: 'left'},
88108
{to: '/docs/matrixshop', label: 'MatrixShop', position: 'left'},
@@ -99,16 +119,24 @@ const config: Config = {
99119
style: 'light',
100120
links: [
101121
{
102-
title: 'Documentation',
122+
title: '文档',
103123
items: [
124+
{
125+
label: '站点总览',
126+
to: '/docs/intro',
127+
},
104128
{
105129
label: '插件列表',
106130
to: '/docs/plugins',
107131
},
132+
{
133+
label: 'AI 搜索',
134+
to: '/ai-search',
135+
},
108136
],
109137
},
110138
{
111-
title: 'Projects',
139+
title: '插件',
112140
items: [
113141
{
114142
label: 'MatrixAuth',
@@ -125,7 +153,7 @@ const config: Config = {
125153
],
126154
},
127155
{
128-
title: 'Repository',
156+
title: '仓库',
129157
items: [
130158
{
131159
label: '54895y.github.io',

i18n/zh-Hans/code.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"theme.IconExternalLink.ariaLabel": {
3+
"message": "(在新标签页中打开)"
4+
},
5+
"theme.colorToggle.ariaLabel.mode.system": {
6+
"message": "跟随系统"
7+
},
8+
"theme.navbar.mobileDropdown.collapseButton.collapseAriaLabel": {
9+
"message": "收起下拉菜单"
10+
},
11+
"theme.navbar.mobileDropdown.collapseButton.expandAriaLabel": {
12+
"message": "展开下拉菜单"
13+
}
14+
}

src/pages/ai-search.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ function getResultTitle(item) {
3535
type === SearchDocumentType.Description ||
3636
type === SearchDocumentType.Keywords
3737
) {
38-
return normalizeText(document.s || page?.t || document.t || 'Untitled');
38+
return normalizeText(document.s || page?.t || document.t || '未命名文档');
3939
}
40-
return normalizeText(document.t || page?.t || 'Untitled');
40+
return normalizeText(document.t || page?.t || '未命名文档');
4141
}
4242

4343
function getResultPath(item) {
@@ -71,9 +71,9 @@ function buildDeepSeekMessages(query, results) {
7171
const url = getResultUrl(result);
7272
return [
7373
`[${index + 1}] ${title}`,
74-
path ? `Path: ${path}` : null,
75-
`URL: ${url}`,
76-
`Snippet: ${snippet}`,
74+
path ? `路径:${path}` : null,
75+
`链接:${url}`,
76+
`摘要:${snippet}`,
7777
]
7878
.filter(Boolean)
7979
.join('\n');
@@ -305,23 +305,23 @@ export default function AiSearchPage() {
305305
<main className={styles.page}>
306306
<div className={styles.shell}>
307307
<section className={styles.heroCard}>
308-
<p className={styles.kicker}>Manual AI Search</p>
308+
<p className={styles.kicker}>手动 AI 搜索</p>
309309
<h1 className={styles.heroTitle}>AI 搜索</h1>
310310
<p className={styles.heroDescription}>
311311
先使用本地索引检索当前 Wiki;只有在你主动点击按钮后,才会调用 DeepSeek 继续回答。
312312
</p>
313313
<div className={styles.heroMeta}>
314-
<span>Provider: DeepSeek</span>
315-
<span>Model: {model}</span>
316-
<span>Mode: 手动触发</span>
314+
<span>提供方:DeepSeek</span>
315+
<span>模型:{model}</span>
316+
<span>触发方式:手动</span>
317317
</div>
318318
</section>
319319

320320
<section className={styles.controlGrid}>
321321
<article className={styles.panel}>
322322
<div className={styles.panelHeader}>
323323
<div>
324-
<p className={styles.sectionKicker}>Step 1</p>
324+
<p className={styles.sectionKicker}>第一步</p>
325325
<h2>本地搜索</h2>
326326
</div>
327327
<Link className={styles.inlineLink} to="/search">
@@ -357,13 +357,13 @@ export default function AiSearchPage() {
357357
<article className={styles.panel}>
358358
<div className={styles.panelHeader}>
359359
<div>
360-
<p className={styles.sectionKicker}>Step 2</p>
361-
<h2>DeepSeek Key</h2>
360+
<p className={styles.sectionKicker}>第二步</p>
361+
<h2>DeepSeek 密钥</h2>
362362
</div>
363363
</div>
364364

365365
<label className={styles.field}>
366-
<span>API Key</span>
366+
<span>API 密钥</span>
367367
<input
368368
className={styles.textInput}
369369
type="password"
@@ -372,7 +372,7 @@ export default function AiSearchPage() {
372372
setApiKey(event.target.value);
373373
setKeyMessage('');
374374
}}
375-
placeholder="输入 DeepSeek API Key"
375+
placeholder="输入 DeepSeek API 密钥"
376376
autoComplete="off"
377377
/>
378378
</label>
@@ -382,12 +382,12 @@ export default function AiSearchPage() {
382382
保存到当前浏览器
383383
</button>
384384
<button className={styles.ghostButton} type="button" onClick={handleClearKey}>
385-
清除本地 Key
385+
清除本地密钥
386386
</button>
387387
</div>
388388

389389
<p className={styles.hint}>
390-
本站部署在 GitHub Pages 上,不能安全地把服务端密钥写进公开仓库。这里的 Key 只会保存在你当前浏览器的本地存储中
390+
本站部署在 GitHub Pages 上,不能安全地把服务端密钥写进公开仓库。这里的密钥只会保存在你当前浏览器的本地存储中
391391
</p>
392392

393393
{keyMessage ? <p className={styles.notice}>{keyMessage}</p> : null}
@@ -398,7 +398,7 @@ export default function AiSearchPage() {
398398
<article className={styles.panel}>
399399
<div className={styles.panelHeader}>
400400
<div>
401-
<p className={styles.sectionKicker}>Local Results</p>
401+
<p className={styles.sectionKicker}>本地结果</p>
402402
<h2>本地命中结果</h2>
403403
</div>
404404
{localResults.length > 0 ? <span className={styles.badge}>{localResults.length}</span> : null}
@@ -431,7 +431,7 @@ export default function AiSearchPage() {
431431
<article className={styles.panel}>
432432
<div className={styles.panelHeader}>
433433
<div>
434-
<p className={styles.sectionKicker}>AI Answer</p>
434+
<p className={styles.sectionKicker}>AI 回答</p>
435435
<h2>DeepSeek 回答</h2>
436436
</div>
437437
<span className={styles.badge}>

0 commit comments

Comments
 (0)