Skip to content

Commit 4b859be

Browse files
committed
Add Simplified Chinese translations for docs
Added Simplified Chinese (.cn.mdx) versions for introduction, quick start, architecture, and configuration documentation. Updated the corresponding English docs for improved clarity and consistency. This enhances accessibility for Chinese-speaking users and maintains parity between language versions.
1 parent dc700de commit 4b859be

File tree

8 files changed

+449
-116
lines changed

8 files changed

+449
-116
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
title: 架构
3+
description: 深入了解 ObjectDocs 的架构、目录结构和数据流。
4+
---
5+
6+
import { Layers, FileJson, Code, FileText } from 'lucide-react';
7+
8+
# 架构
9+
10+
ObjectDocs 建立在严格的 **关注点分离 (Separation of Concerns)** 理念之上,将表现层、配置层和内容层完全分开。
11+
12+
## 核心原则
13+
14+
### 1. 配置即代码 (Configuration as Code)
15+
16+
与传统的文档站点将结构硬编码在 React 组件中不同,ObjectDocs 将文档组织视为 **数据**
17+
18+
<Cards>
19+
<Card icon={<FileJson />} title="元数据驱动">
20+
导航、侧边栏和页面顺序均由 JSON 文件定义,而非 React 代码。
21+
</Card>
22+
<Card icon={<Layers />} title="逻辑无关">
23+
内容创建者不需要关心路由逻辑或 UI 组件的实现细节。
24+
</Card>
25+
</Cards>
26+
27+
### 2. 本地化内容管理
28+
29+
每个文档目录都是自包含的。如果你要新增一个章节,只需在该目录下创建文件并更新同级的 `meta.json`。这使得在大型团队中进行多人协作变得不容易冲突。
30+
31+
## 目录结构
32+
33+
一个标准的 ObjectDocs 项目结构如下:
34+
35+
```text
36+
.
37+
├── content/ # [数据层] 原始内容
38+
│ ├── docs.site.json # 全局设置 (导航, Logo, 品牌)
39+
│ └── docs/
40+
│ ├── meta.json # 目录结构 & 排序控制
41+
│ └── index.mdx # 文档内容
42+
├── package.json
43+
└── public/ # 静态资源 (图片等)
44+
```
45+
46+
## 数据流向
47+
48+
1. **构建时**: `@objectdocs/site` 读取 `content/` 下的所有 MDX 和 JSON 文件。
49+
2. **解析**: Fumadocs 引擎解析元数据,构建导航树。
50+
3. **渲染**: Next.js (App Router) 将内容渲染为 React Server Components。
51+
4. **交互**: 客户端组件(如 `<Cards>`, `<Steps>`)在浏览器中激活。
52+
53+
### 为什么这样设计?
54+
55+
这种架构使得我们能够:
56+
57+
* **多产品支持**: 通过切换不同的 `content` 目录,可以在同一套代码库中支持多个产品的文档。
58+
* **低代码集成**: 因为内容与 UI 分离,我们可以更容易地注入动态的低代码组件演示。
Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,58 @@
11
---
2-
title: 架构
3-
description: 深入了解 ObjectDocs 的架构、目录结构和数据流。
2+
title: Architecture
3+
description: Deep dive into ObjectDocs architecture, directory structure, and data flow.
44
---
55

66
import { Layers, FileJson, Code, FileText } from 'lucide-react';
77

8-
# 架构
8+
# Architecture
99

10-
ObjectDocs 建立在严格的 **关注点分离 (Separation of Concerns)** 理念之上,将表现层、配置层和内容层完全分开。
10+
ObjectDocs is built on a strict **Separation of Concerns** philosophy, completely separating the presentation, configuration, and content layers.
1111

12-
## 核心原则
12+
## Core Principles
1313

14-
### 1. 配置即代码 (Configuration as Code)
14+
### 1. Configuration as Code
1515

16-
与传统的文档站点将结构硬编码在 React 组件中不同,ObjectDocs 将文档组织视为 **数据**
16+
Unlike traditional documentation sites where structure is hardcoded in React components, ObjectDocs treats documentation organization as **data**.
1717

1818
<Cards>
19-
<Card icon={<FileJson />} title="元数据驱动">
20-
导航、侧边栏和页面顺序均由 JSON 文件定义,而非 React 代码。
19+
<Card icon={<FileJson />} title="Metadata-Driven">
20+
Navigation, sidebar, and page order are all defined by JSON files, not React code.
2121
</Card>
22-
<Card icon={<Layers />} title="逻辑无关">
23-
内容创建者不需要关心路由逻辑或 UI 组件的实现细节。
22+
<Card icon={<Layers />} title="Logic Agnostic">
23+
Content creators don't need to care about routing logic or UI component implementation details.
2424
</Card>
2525
</Cards>
2626

27-
### 2. 本地化内容管理
27+
### 2. Localized Content Management
2828

29-
每个文档目录都是自包含的。如果你要新增一个章节,只需在该目录下创建文件并更新同级的 `meta.json`。这使得在大型团队中进行多人协作变得不容易冲突。
29+
Each documentation directory is self-contained. If you want to add a new section, just create files in that directory and update the sibling `meta.json`. This makes multi-person collaboration in large teams less prone to conflicts.
3030

31-
## 目录结构
31+
## Directory Structure
3232

33-
一个标准的 ObjectDocs 项目结构如下:
33+
A standard ObjectDocs project structure looks like this:
3434

3535
```text
3636
.
37-
├── content/ # [数据层] 原始内容
38-
│ ├── docs.site.json # 全局设置 (导航, Logo, 品牌)
37+
├── content/ # [Data Layer] Raw Content
38+
│ ├── docs.site.json # Global settings (Nav, Logo, Branding)
3939
│ └── docs/
40-
│ ├── meta.json # 目录结构 & 排序控制
41-
│ └── index.mdx # 文档内容
40+
│ ├── meta.json # Directory structure & sorting control
41+
│ └── index.mdx # Documentation content
4242
├── package.json
43-
└── public/ # 静态资源 (图片等)
43+
└── public/ # Static assets (images, etc.)
4444
```
4545

46-
## 数据流向
46+
## Data Flow
4747

48-
1. **构建时**: `@objectdocs/site` 读取 `content/` 下的所有 MDX JSON 文件。
49-
2. **解析**: Fumadocs 引擎解析元数据,构建导航树。
50-
3. **渲染**: Next.js (App Router) 将内容渲染为 React Server Components
51-
4. **交互**: 客户端组件(如 `<Cards>`, `<Steps>`)在浏览器中激活。
48+
1. **Build Time**: `@objectdocs/site` reads all MDX and JSON files under `content/`.
49+
2. **Parsing**: The Fumadocs engine parses metadata and builds the navigation tree.
50+
3. **Rendering**: Next.js (App Router) renders content as React Server Components.
51+
4. **Interaction**: Client components (like `<Cards>`, `<Steps>`) activate in the browser.
5252

53-
### 为什么这样设计?
53+
### Why Design It This Way?
5454

55-
这种架构使得我们能够:
55+
This architecture allows us to:
5656

57-
* **多产品支持**: 通过切换不同的 `content` 目录,可以在同一套代码库中支持多个产品的文档。
58-
* **低代码集成**: 因为内容与 UI 分离,我们可以更容易地注入动态的低代码组件演示。
57+
* **Multi-Product Support**: By switching different `content` directories, multiple product documentations can be supported within the same codebase.
58+
* **Low-Code Integration**: Since content is separated from UI, we can more easily inject dynamic low-code component demos.
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
title: 配置
3+
description: 了解如何通过 JSON 文件自定义您的 ObjectDocs 站点。
4+
---
5+
6+
import { Settings, Palette, Navigation, Layout } from 'lucide-react';
7+
8+
# 配置
9+
10+
ObjectDocs 遵循 **配置即代码 (Configuration as Code)** 的原则。所有的站点设置都通过 JSON 文件定义,易于版本控制和协作。
11+
12+
## 全局配置
13+
14+
### docs.site.json
15+
16+
主配置文件位于 `content/docs.site.json`。该文件控制整个文档站点的全局设置。
17+
18+
```json
19+
{
20+
"branding": {
21+
"name": "ObjectDocs",
22+
"logo": {
23+
"light": "/logo.svg",
24+
"dark": "/logo-dark.svg"
25+
}
26+
},
27+
"links": [
28+
{ "text": "Guide", "url": "/docs" },
29+
{ "text": "GitHub", "url": "https://github.com/objectstack-ai", "icon": "github" }
30+
]
31+
}
32+
```
33+
34+
### 配置项说明
35+
36+
| 属性 | 类型 | 说明 |
37+
| :--- | :--- | :--- |
38+
| `branding.name` | `string` | 站点名称,显示在导航栏左侧。 |
39+
| `branding.logo` | `object` | 站点 Log 图片路径,支持亮色/暗色模式。 |
40+
| `links` | `array` | 顶部导航栏链接列表。 |
41+
42+
## 目录与导航配置
43+
44+
### meta.json
45+
46+
每个文档目录下都可以放置一个 `meta.json` 文件,用于控制该目录下的侧边栏结构和页面顺序。
47+
48+
**示例结构:**
49+
50+
```text
51+
content/docs/
52+
├── meta.json # 根目录配置
53+
├── index.mdx
54+
└── getting-started/
55+
├── meta.json # 子目录配置
56+
├── index.mdx
57+
└── configuration.mdx
58+
```
59+
60+
**content/docs/meta.json:**
61+
62+
```json
63+
{
64+
"title": "Documentation",
65+
"pages": [
66+
"index",
67+
"getting-started",
68+
"components"
69+
]
70+
}
71+
```
72+
73+
**content/docs/getting-started/meta.json:**
74+
75+
```json
76+
{
77+
"title": "快速开始",
78+
"pages": [
79+
"index", // 对应 index.mdx (快速开始)
80+
"architecture", // 对应 architecture.mdx (架构)
81+
"configuration" // 对应 configuration.mdx (配置)
82+
]
83+
}
84+
```
85+
86+
### 如果不使用 meta.json
87+
88+
如果没有 `meta.json`,ObjectDocs 会按字母顺序自动列出该目录下的所有 `.mdx` 文件。对于正式文档,我们强烈建议使用 `meta.json` 以确保顺序可控。
89+
90+
## 页面配置 (Frontmatter)
91+
92+
每个 MDX 文件的顶部都可以包含 Frontmatter 元数据:
93+
94+
```yaml
95+
---
96+
title: 页面标题
97+
description: 页面描述(用于 SEO 和搜索预览)
98+
icon: Rocket # 可选:页面图标名称
99+
full: false # 可选:是否隐藏右侧目录 (Table of Contents)
100+
---
101+
```
Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
2-
title: 配置
3-
description: 了解如何通过 JSON 文件自定义您的 ObjectDocs 站点。
2+
title: Configuration
3+
description: Learn how to customize your ObjectDocs site via JSON files.
44
---
55

66
import { Settings, Palette, Navigation, Layout } from 'lucide-react';
77

8-
# 配置
8+
# Configuration
99

10-
ObjectDocs 遵循 **配置即代码 (Configuration as Code)** 的原则。所有的站点设置都通过 JSON 文件定义,易于版本控制和协作。
10+
ObjectDocs follows the **Configuration as Code** principle. All site settings are defined via JSON files, making them easy to version control and collaborate on.
1111

12-
## 全局配置
12+
## Global Configuration
1313

1414
### docs.site.json
1515

16-
主配置文件位于 `content/docs.site.json`。该文件控制整个文档站点的全局设置。
16+
The main configuration file is located at `content/docs.site.json`. This file controls the global settings for the entire documentation site.
1717

1818
```json
1919
{
@@ -31,28 +31,28 @@ ObjectDocs 遵循 **配置即代码 (Configuration as Code)** 的原则。所有
3131
}
3232
```
3333

34-
### 配置项说明
34+
### Configuration Options
3535

36-
| 属性 | 类型 | 说明 |
36+
| Property | Type | Description |
3737
| :--- | :--- | :--- |
38-
| `branding.name` | `string` | 站点名称,显示在导航栏左侧。 |
39-
| `branding.logo` | `object` | 站点 Log 图片路径,支持亮色/暗色模式。 |
40-
| `links` | `array` | 顶部导航栏链接列表。 |
38+
| `branding.name` | `string` | Site name, displayed on the left side of the navbar. |
39+
| `branding.logo` | `object` | Site logo image paths, supports light/dark mode. |
40+
| `links` | `array` | List of links in the top navigation bar. |
4141

42-
## 目录与导航配置
42+
## Directory & Navigation Configuration
4343

4444
### meta.json
4545

46-
每个文档目录下都可以放置一个 `meta.json` 文件,用于控制该目录下的侧边栏结构和页面顺序。
46+
Each documentation directory can contain a `meta.json` file, which maps to the sidebar structure and page order for that directory.
4747

48-
**示例结构:**
48+
**Example Structure:**
4949

5050
```text
5151
content/docs/
52-
├── meta.json # 根目录配置
52+
├── meta.json # Root directory config
5353
├── index.mdx
5454
└── getting-started/
55-
├── meta.json # 子目录配置
55+
├── meta.json # Subdirectory config
5656
├── index.mdx
5757
└── configuration.mdx
5858
```
@@ -74,28 +74,28 @@ content/docs/
7474

7575
```json
7676
{
77-
"title": "快速开始",
77+
"title": "Quick Start",
7878
"pages": [
79-
"index", // 对应 index.mdx (快速开始)
80-
"architecture", // 对应 architecture.mdx (架构)
81-
"configuration" // 对应 configuration.mdx (配置)
79+
"index", // Maps to index.mdx (Quick Start)
80+
"architecture", // Maps to architecture.mdx
81+
"configuration" // Maps to configuration.mdx
8282
]
8383
}
8484
```
8585

86-
### 如果不使用 meta.json
86+
### Without meta.json
8787

88-
如果没有 `meta.json`ObjectDocs 会按字母顺序自动列出该目录下的所有 `.mdx` 文件。对于正式文档,我们强烈建议使用 `meta.json` 以确保顺序可控。
88+
If `meta.json` is missing, ObjectDocs will automatically list all `.mdx` files in that directory alphabetically. For official documentation, we strongly recommend using `meta.json` to ensure controlled ordering.
8989

90-
## 页面配置 (Frontmatter)
90+
## Page Configuration (Frontmatter)
9191

92-
每个 MDX 文件的顶部都可以包含 Frontmatter 元数据:
92+
Top of each MDX file can contain Frontmatter metadata:
9393

9494
```yaml
9595
---
96-
title: 页面标题
97-
description: 页面描述(用于 SEO 和搜索预览)
98-
icon: Rocket # 可选:页面图标名称
99-
full: false # 可选:是否隐藏右侧目录 (Table of Contents)
96+
title: Page Title
97+
description: Page description (used for SEO and search preview)
98+
icon: Rocket # Optional: Page icon name
99+
full: false # Optional: Whether to hide the right Table of Contents
100100
---
101101
```

0 commit comments

Comments
 (0)