create-rspress 2.0.13 → 2.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/README.md +17 -2
  2. package/dist/index.js +33 -14
  3. package/package.json +6 -6
  4. package/template-basic/docs/_nav.json +16 -0
  5. package/template-basic/docs/api/_meta.json +1 -0
  6. package/template-basic/docs/api/commands.mdx +7 -0
  7. package/template-basic/docs/api/index.mdx +6 -0
  8. package/template-basic/docs/guide/_meta.json +12 -0
  9. package/template-basic/docs/guide/start/_meta.json +1 -0
  10. package/template-basic/docs/guide/start/getting-started.md +51 -0
  11. package/template-basic/docs/guide/start/introduction.md +15 -0
  12. package/template-basic/docs/guide/use-mdx/_meta.json +1 -0
  13. package/template-basic/docs/guide/use-mdx/code-blocks/_meta.json +1 -0
  14. package/template-basic/docs/guide/use-mdx/code-blocks/index.mdx +9 -0
  15. package/template-basic/docs/guide/use-mdx/code-blocks/meta.md +7 -0
  16. package/template-basic/docs/guide/use-mdx/code-blocks/title.md +5 -0
  17. package/template-basic/docs/guide/use-mdx/components.mdx +47 -0
  18. package/template-basic/docs/guide/use-mdx/container.md +33 -0
  19. package/template-basic/docs/index.md +43 -0
  20. package/template-basic-theme/theme/index.css +12 -0
  21. package/template-basic-theme/theme/index.tsx +4 -0
  22. package/template-common/package.json +1 -1
  23. package/template-common/rspress.config.ts +1 -0
  24. package/template-i18n/docs/en/_nav.json +16 -0
  25. package/template-i18n/docs/en/api/_meta.json +1 -0
  26. package/template-i18n/docs/en/api/commands.mdx +11 -0
  27. package/template-i18n/docs/en/api/index.mdx +7 -0
  28. package/template-i18n/docs/en/guide/_meta.json +12 -0
  29. package/template-i18n/docs/en/guide/start/_meta.json +1 -0
  30. package/template-i18n/docs/en/guide/start/getting-started.md +55 -0
  31. package/template-i18n/docs/en/guide/start/introduction.md +19 -0
  32. package/template-i18n/docs/en/guide/use-mdx/_meta.json +1 -0
  33. package/template-i18n/docs/en/guide/use-mdx/code-blocks/_meta.json +1 -0
  34. package/template-i18n/docs/en/guide/use-mdx/code-blocks/index.mdx +13 -0
  35. package/template-i18n/docs/en/guide/use-mdx/code-blocks/meta.md +11 -0
  36. package/template-i18n/docs/en/guide/use-mdx/code-blocks/title.md +9 -0
  37. package/template-i18n/docs/en/guide/use-mdx/components.mdx +51 -0
  38. package/template-i18n/docs/en/guide/use-mdx/container.md +37 -0
  39. package/template-i18n/docs/en/index.md +44 -0
  40. package/template-i18n/docs/zh/_nav.json +16 -0
  41. package/template-i18n/docs/zh/api/_meta.json +12 -0
  42. package/template-i18n/docs/zh/api/commands.mdx +11 -0
  43. package/template-i18n/docs/zh/api/index.mdx +7 -0
  44. package/template-i18n/docs/zh/guide/_meta.json +12 -0
  45. package/template-i18n/docs/zh/guide/start/_meta.json +12 -0
  46. package/template-i18n/docs/zh/guide/start/getting-started.md +55 -0
  47. package/template-i18n/docs/zh/guide/start/introduction.md +19 -0
  48. package/template-i18n/docs/zh/guide/use-mdx/_meta.json +17 -0
  49. package/template-i18n/docs/zh/guide/use-mdx/code-blocks/_meta.json +12 -0
  50. package/template-i18n/docs/zh/guide/use-mdx/code-blocks/index.mdx +13 -0
  51. package/template-i18n/docs/zh/guide/use-mdx/code-blocks/meta.md +11 -0
  52. package/template-i18n/docs/zh/guide/use-mdx/code-blocks/title.md +9 -0
  53. package/template-i18n/docs/zh/guide/use-mdx/components.mdx +51 -0
  54. package/template-i18n/docs/zh/guide/use-mdx/container.md +37 -0
  55. package/template-i18n/docs/zh/index.md +44 -0
  56. package/template-i18n/rspress.config.ts +37 -0
  57. package/template-i18n-theme/docs/en/_nav.json +16 -0
  58. package/template-i18n-theme/docs/en/api/_meta.json +1 -0
  59. package/template-i18n-theme/docs/en/api/commands.mdx +11 -0
  60. package/template-i18n-theme/docs/en/api/index.mdx +7 -0
  61. package/template-i18n-theme/docs/en/guide/_meta.json +12 -0
  62. package/template-i18n-theme/docs/en/guide/start/_meta.json +1 -0
  63. package/template-i18n-theme/docs/en/guide/start/getting-started.md +55 -0
  64. package/template-i18n-theme/docs/en/guide/start/introduction.md +19 -0
  65. package/template-i18n-theme/docs/en/guide/use-mdx/_meta.json +1 -0
  66. package/template-i18n-theme/docs/en/guide/use-mdx/code-blocks/_meta.json +1 -0
  67. package/template-i18n-theme/docs/en/guide/use-mdx/code-blocks/index.mdx +13 -0
  68. package/template-i18n-theme/docs/en/guide/use-mdx/code-blocks/meta.md +11 -0
  69. package/template-i18n-theme/docs/en/guide/use-mdx/code-blocks/title.md +9 -0
  70. package/template-i18n-theme/docs/en/guide/use-mdx/components.mdx +51 -0
  71. package/template-i18n-theme/docs/en/guide/use-mdx/container.md +37 -0
  72. package/template-i18n-theme/docs/en/index.md +44 -0
  73. package/template-i18n-theme/docs/zh/_nav.json +16 -0
  74. package/template-i18n-theme/docs/zh/api/_meta.json +12 -0
  75. package/template-i18n-theme/docs/zh/api/commands.mdx +11 -0
  76. package/template-i18n-theme/docs/zh/api/index.mdx +7 -0
  77. package/template-i18n-theme/docs/zh/guide/_meta.json +12 -0
  78. package/template-i18n-theme/docs/zh/guide/start/_meta.json +12 -0
  79. package/template-i18n-theme/docs/zh/guide/start/getting-started.md +55 -0
  80. package/template-i18n-theme/docs/zh/guide/start/introduction.md +19 -0
  81. package/template-i18n-theme/docs/zh/guide/use-mdx/_meta.json +17 -0
  82. package/template-i18n-theme/docs/zh/guide/use-mdx/code-blocks/_meta.json +12 -0
  83. package/template-i18n-theme/docs/zh/guide/use-mdx/code-blocks/index.mdx +13 -0
  84. package/template-i18n-theme/docs/zh/guide/use-mdx/code-blocks/meta.md +11 -0
  85. package/template-i18n-theme/docs/zh/guide/use-mdx/code-blocks/title.md +9 -0
  86. package/template-i18n-theme/docs/zh/guide/use-mdx/components.mdx +51 -0
  87. package/template-i18n-theme/docs/zh/guide/use-mdx/container.md +37 -0
  88. package/template-i18n-theme/docs/zh/index.md +44 -0
  89. package/template-i18n-theme/rspress.config.ts +37 -0
  90. package/template-i18n-theme/theme/env.d.ts +9 -0
  91. package/template-i18n-theme/theme/index.css +12 -0
  92. package/template-i18n-theme/theme/index.tsx +4 -0
  93. package/template-basic/template-placeholder +0 -1
  94. package/template-custom-theme/theme/index.css +0 -6
  95. package/template-custom-theme/theme/index.tsx +0 -3
  96. /package/{template-common → template-basic-theme}/docs/_nav.json +0 -0
  97. /package/{template-common → template-basic-theme}/docs/api/_meta.json +0 -0
  98. /package/{template-common → template-basic-theme}/docs/api/commands.mdx +0 -0
  99. /package/{template-common → template-basic-theme}/docs/api/index.mdx +0 -0
  100. /package/{template-common → template-basic-theme}/docs/guide/_meta.json +0 -0
  101. /package/{template-common → template-basic-theme}/docs/guide/start/_meta.json +0 -0
  102. /package/{template-common → template-basic-theme}/docs/guide/start/getting-started.md +0 -0
  103. /package/{template-common → template-basic-theme}/docs/guide/start/introduction.md +0 -0
  104. /package/{template-common → template-basic-theme}/docs/guide/use-mdx/_meta.json +0 -0
  105. /package/{template-common → template-basic-theme}/docs/guide/use-mdx/code-blocks/_meta.json +0 -0
  106. /package/{template-common → template-basic-theme}/docs/guide/use-mdx/code-blocks/index.mdx +0 -0
  107. /package/{template-common → template-basic-theme}/docs/guide/use-mdx/code-blocks/meta.md +0 -0
  108. /package/{template-common → template-basic-theme}/docs/guide/use-mdx/code-blocks/title.md +0 -0
  109. /package/{template-common → template-basic-theme}/docs/guide/use-mdx/components.mdx +0 -0
  110. /package/{template-common → template-basic-theme}/docs/guide/use-mdx/container.md +0 -0
  111. /package/{template-common → template-basic-theme}/docs/index.md +0 -0
  112. /package/{template-custom-theme → template-basic-theme}/theme/env.d.ts +0 -0
@@ -0,0 +1,51 @@
1
+ ---
2
+ description: Use Markdown, MDX, React components, and Rspress built-in components in documentation pages.
3
+ ---
4
+
5
+ # MDX & React components
6
+
7
+ Rspress supports not only Markdown but also [MDX](https://mdxjs.com/), a powerful way to develop content.
8
+
9
+ ## Markdown
10
+
11
+ MDX is a superset of Markdown, which means you can write Markdown files as usual. For example:
12
+
13
+ ```md
14
+ # Hello world
15
+ ```
16
+
17
+ ## Use components
18
+
19
+ When you want to use React components in Markdown files, you should name your files with `.mdx` extension.
20
+
21
+ ```mdx
22
+ // docs/index.mdx
23
+ import { CustomComponent } from './custom';
24
+
25
+ # Hello world
26
+
27
+ <CustomComponent />
28
+ ```
29
+
30
+ ## Use Rspress built-in components
31
+
32
+ import { Tabs, Tab } from '@rspress/core/theme';
33
+
34
+ <Tabs>
35
+
36
+ <Tab label="foo.js">
37
+
38
+ ```js
39
+ console.log('foo');
40
+ ```
41
+
42
+ </Tab>
43
+ <Tab label="bar.js">
44
+
45
+ ```js
46
+ console.log('bar');
47
+ ```
48
+
49
+ </Tab>
50
+
51
+ </Tabs>
@@ -0,0 +1,37 @@
1
+ ---
2
+ description: Create Rspress custom containers for tips, info, warnings, dangers, details, and custom titles.
3
+ ---
4
+
5
+ # Container
6
+
7
+ You can use the `:::` syntax to create custom containers and support custom titles.
8
+
9
+ ## Examples
10
+
11
+ :::tip
12
+ This is a `block` of type `tip`
13
+ :::
14
+
15
+ :::info
16
+ This is a `block` of type `info`
17
+ :::
18
+
19
+ :::warning
20
+ This is a `block` of type `warning`
21
+ :::
22
+
23
+ :::danger
24
+ This is a `block` of type `danger`
25
+ :::
26
+
27
+ ::: details
28
+ This is a `block` of type `details`
29
+ :::
30
+
31
+ :::tip Custom Title
32
+ This is a `block` of `Custom Title`
33
+ :::
34
+
35
+ :::tip{title="Custom Title"}
36
+ This is a `block` of `Custom Title`
37
+ :::
@@ -0,0 +1,44 @@
1
+ ---
2
+ description: Rspress starter homepage with guide, MDX, search, AI, SSG, and theme customization links.
3
+ pageType: home
4
+
5
+ hero:
6
+ name: My Site
7
+ text: A cool website!
8
+ tagline: This is the tagline
9
+ actions:
10
+ - theme: brand
11
+ text: Quick Start
12
+ link: /guide/start/introduction
13
+ - theme: alt
14
+ text: GitHub
15
+ link: https://github.com/web-infra-dev/rspress
16
+ image:
17
+ src: /rspress-icon.png
18
+ alt: Logo
19
+ features:
20
+ - title: Blazing fast build speed
21
+ details: The core compilation module is based on the Rust front-end toolchain, providing a more ultimate development experience.
22
+ icon: 🏃🏻‍♀️
23
+ link: /guide/start/introduction
24
+ - title: Support for MDX content writing
25
+ details: MDX is a powerful way to write content, allowing you to use React components in Markdown.
26
+ icon: 📦
27
+ link: /guide/use-mdx/components
28
+ - title: Built-in full-text search
29
+ details: Automatically generates a full-text search index for you during construction, providing out-of-the-box full-text search capabilities.
30
+ icon: 🎨
31
+ link: https://rspress.rs/guide/advanced/custom-search
32
+ - title: AI-friendly
33
+ details: Generate llms.txt and Markdown files compliant with the llms.txt specification through SSG-MD, making it easier for large language models to understand and use your documentation.
34
+ icon: 🤖
35
+ link: https://rspress.rs/guide/basic/ssg-md
36
+ - title: Static site generation
37
+ details: In production, it automatically builds into static HTML files, which can be easily deployed anywhere.
38
+ icon: 🌈
39
+ link: https://rspress.rs/guide/basic/ssg
40
+ - title: Providing multiple custom capabilities
41
+ details: Through its extension mechanism, you can easily extend theme UI and build process.
42
+ icon: 🔥
43
+ link: https://rspress.rs/guide/basic/custom-theme
44
+ ---
@@ -0,0 +1,16 @@
1
+ [
2
+ {
3
+ "text": "指南",
4
+ "link": "/guide/start/introduction",
5
+ "activeMatch": "/guide/"
6
+ },
7
+ {
8
+ "text": "API",
9
+ "link": "/api/",
10
+ "activeMatch": "/api/"
11
+ },
12
+ {
13
+ "text": "文档",
14
+ "link": "https://rspress.rs/"
15
+ }
16
+ ]
@@ -0,0 +1,12 @@
1
+ [
2
+ {
3
+ "type": "file",
4
+ "name": "index",
5
+ "label": "API 概览"
6
+ },
7
+ {
8
+ "type": "file",
9
+ "name": "commands",
10
+ "label": "命令"
11
+ }
12
+ ]
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: Rspress 本地开发、生产构建和本地预览脚本的命令参考。
3
+ ---
4
+
5
+ # 命令
6
+
7
+ ## dev
8
+
9
+ ## build
10
+
11
+ ## preview
@@ -0,0 +1,7 @@
1
+ ---
2
+ title: API 概览
3
+ description: Rspress 入门模板 API 区域和可用参考页面的概览。
4
+ overview: true
5
+ ---
6
+
7
+ 这是一个 API 概览页面,用于列出所有可用 API。
@@ -0,0 +1,12 @@
1
+ [
2
+ {
3
+ "type": "dir-section-header",
4
+ "name": "start",
5
+ "label": "快速开始"
6
+ },
7
+ {
8
+ "type": "dir-section-header",
9
+ "name": "use-mdx",
10
+ "label": "Markdown 与 MDX"
11
+ }
12
+ ]
@@ -0,0 +1,12 @@
1
+ [
2
+ {
3
+ "type": "file",
4
+ "name": "introduction",
5
+ "label": "介绍"
6
+ },
7
+ {
8
+ "type": "file",
9
+ "name": "getting-started",
10
+ "label": "快速开始"
11
+ }
12
+ ]
@@ -0,0 +1,55 @@
1
+ ---
2
+ description: 了解 Rspress 项目结构、本地开发、生产构建、本地预览和后续学习路径。
3
+ ---
4
+
5
+ # 快速开始
6
+
7
+ ## 项目结构
8
+
9
+ 使用 `create-rspress` 创建项目后,你会得到以下项目结构:
10
+
11
+ - `docs/`:文档源码目录,通过 `rspress.config.ts` 中的 `root` 配置。
12
+ - `docs/_nav.json`:导航栏配置。
13
+ - `docs/guide/_meta.json`:指南区域的侧边栏配置。
14
+ - `docs/public/`:静态资源目录。
15
+ - `theme/`:可选的自定义主题目录,在选择自定义主题模板时生成。
16
+ - `rspress.config.ts`:Rspress 配置文件。
17
+
18
+ ## 本地开发
19
+
20
+ 启动本地开发服务器:
21
+
22
+ ```bash
23
+ npm run dev
24
+ ```
25
+
26
+ :::tip
27
+
28
+ 你可以使用 `--port` 或 `--host` 指定端口号或主机,例如 `rspress dev --port 8080 --host 0.0.0.0`。
29
+
30
+ :::
31
+
32
+ ## 生产构建
33
+
34
+ 构建生产站点:
35
+
36
+ ```bash
37
+ npm run build
38
+ ```
39
+
40
+ 默认情况下,Rspress 会输出到 `doc_build` 目录。
41
+
42
+ ## 预览
43
+
44
+ 本地预览生产构建结果:
45
+
46
+ ```bash
47
+ npm run preview
48
+ ```
49
+
50
+ ## 下一步
51
+
52
+ - 学习如何在文档中使用 [MDX 与 React 组件](/guide/use-mdx/components)。
53
+ - 了解 [代码块](/guide/use-mdx/code-blocks/) 的语法高亮和行高亮。
54
+ - 学习用于提示、警告等内容的 [自定义容器](/guide/use-mdx/container)。
55
+ - 浏览完整的 [Rspress 文档](https://rspress.rs/zh/) 了解高级能力。
@@ -0,0 +1,19 @@
1
+ ---
2
+ description: 介绍 Rspress 的构建性能、AI 原生输出、MDX 支持、基础能力和扩展机制。
3
+ ---
4
+
5
+ # 介绍
6
+
7
+ Rspress 是一个基于 [Rsbuild](https://rsbuild.rs/) 的静态站点生成器,使用 React 框架渲染。它内置默认文档主题,你可以用 Rspress 快速构建文档站点。
8
+
9
+ ## 为什么选择 Rspress
10
+
11
+ - **构建性能**。核心编译模块基于 Rust 前端工具链,提供毫秒级启动和更极致的开发体验。
12
+ - **AI 原生**。技术文档不仅服务人类读者,也可以通过 SSG-MD 更好地被 AI 理解和使用。
13
+ - **MDX 支持**。MDX 是一种强大的内容编写方式,可以在 Markdown 中使用 React 组件。
14
+ - **基础能力**。包括全文搜索、国际化、多版本支持、组件库文档等。
15
+ - **可扩展性**。提供内置插件系统,支持通过插件 API 扩展 Rspress。
16
+
17
+ ## 试用 Rspress
18
+
19
+ 前往 [快速开始](/guide/start/getting-started) 了解如何使用 Rspress 构建文档站点。
@@ -0,0 +1,17 @@
1
+ [
2
+ {
3
+ "type": "file",
4
+ "name": "components",
5
+ "label": "MDX 与 React 组件"
6
+ },
7
+ {
8
+ "type": "dir",
9
+ "name": "code-blocks",
10
+ "label": "代码块"
11
+ },
12
+ {
13
+ "type": "file",
14
+ "name": "container",
15
+ "label": "容器"
16
+ }
17
+ ]
@@ -0,0 +1,12 @@
1
+ [
2
+ {
3
+ "type": "file",
4
+ "name": "title",
5
+ "label": "标题"
6
+ },
7
+ {
8
+ "type": "file",
9
+ "name": "meta",
10
+ "label": "元信息"
11
+ }
12
+ ]
@@ -0,0 +1,13 @@
1
+ ---
2
+ description: 使用 Shiki 为 Rspress 代码块配置语法高亮和自动语言处理。
3
+ ---
4
+
5
+ # 代码块
6
+
7
+ Rspress 使用 [Shiki](https://shiki.style) 在编译时进行语法高亮,这意味着运行时性能更好。
8
+
9
+ 使用多种语言的代码块时,对应语言会在编译时自动检测,运行时包体积不会增加。支持的编程语言请参考 [Shiki 支持语言列表](https://shiki.style/languages)。
10
+
11
+ ```js
12
+ console.log('Hello World');
13
+ ```
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: 为 Rspress 代码块添加行号、换行和标题等元信息。
3
+ ---
4
+
5
+ # 元信息
6
+
7
+ 除了标题,我们还有一些其他元信息属性。
8
+
9
+ ```ts lineNumbers wrapCode title="example.ts"
10
+ const longLine = 'This code block has line numbers, code wrapping, and a title';
11
+ ```
@@ -0,0 +1,9 @@
1
+ ---
2
+ description: 使用 Markdown 代码围栏元信息为 Rspress 代码块添加文件标题。
3
+ ---
4
+
5
+ # 标题
6
+
7
+ ```js title="foo.js"
8
+ console.log('Hello World');
9
+ ```
@@ -0,0 +1,51 @@
1
+ ---
2
+ description: 在文档页面中使用 Markdown、MDX、React 组件和 Rspress 内置组件。
3
+ ---
4
+
5
+ # MDX 与 React 组件
6
+
7
+ Rspress 不仅支持 Markdown,还支持 [MDX](https://mdxjs.com/),这是一种强大的内容开发方式。
8
+
9
+ ## Markdown
10
+
11
+ MDX 是 Markdown 的超集,这意味着你可以像往常一样编写 Markdown 文件。例如:
12
+
13
+ ```md
14
+ # Hello world
15
+ ```
16
+
17
+ ## 使用组件
18
+
19
+ 当你想在 Markdown 文件中使用 React 组件时,应该使用 `.mdx` 扩展名命名文件。
20
+
21
+ ```mdx
22
+ // docs/index.mdx
23
+ import { CustomComponent } from './custom';
24
+
25
+ # Hello world
26
+
27
+ <CustomComponent />
28
+ ```
29
+
30
+ ## 使用 Rspress 内置组件
31
+
32
+ import { Tabs, Tab } from '@rspress/core/theme';
33
+
34
+ <Tabs>
35
+
36
+ <Tab label="foo.js">
37
+
38
+ ```js
39
+ console.log('foo');
40
+ ```
41
+
42
+ </Tab>
43
+ <Tab label="bar.js">
44
+
45
+ ```js
46
+ console.log('bar');
47
+ ```
48
+
49
+ </Tab>
50
+
51
+ </Tabs>
@@ -0,0 +1,37 @@
1
+ ---
2
+ description: 创建 Rspress 自定义容器,用于提示、信息、警告、危险、详情和自定义标题。
3
+ ---
4
+
5
+ # 容器
6
+
7
+ 你可以使用 `:::` 语法创建自定义容器,并支持自定义标题。
8
+
9
+ ## 示例
10
+
11
+ :::tip
12
+ 这是一个 `tip` 类型的 `block`
13
+ :::
14
+
15
+ :::info
16
+ 这是一个 `info` 类型的 `block`
17
+ :::
18
+
19
+ :::warning
20
+ 这是一个 `warning` 类型的 `block`
21
+ :::
22
+
23
+ :::danger
24
+ 这是一个 `danger` 类型的 `block`
25
+ :::
26
+
27
+ ::: details
28
+ 这是一个 `details` 类型的 `block`
29
+ :::
30
+
31
+ :::tip Custom Title
32
+ 这是一个 `Custom Title` 的 `block`
33
+ :::
34
+
35
+ :::tip{title="Custom Title"}
36
+ 这是一个 `Custom Title` 的 `block`
37
+ :::
@@ -0,0 +1,44 @@
1
+ ---
2
+ description: Rspress 入门模板首页,包含指南、MDX、搜索、AI、SSG 和主题定制入口。
3
+ pageType: home
4
+
5
+ hero:
6
+ name: 我的站点
7
+ text: 一个很酷的网站!
8
+ tagline: 这是网站的副标题
9
+ actions:
10
+ - theme: brand
11
+ text: 快速开始
12
+ link: /zh/guide/start/introduction
13
+ - theme: alt
14
+ text: GitHub
15
+ link: https://github.com/web-infra-dev/rspress
16
+ image:
17
+ src: /rspress-icon.png
18
+ alt: Logo
19
+ features:
20
+ - title: 极速构建
21
+ details: 核心编译模块基于 Rust 前端工具链,提供更极致的开发体验。
22
+ icon: 🏃🏻‍♀️
23
+ link: /zh/guide/start/introduction
24
+ - title: 支持 MDX 内容编写
25
+ details: MDX 是一种强大的内容编写方式,可以在 Markdown 中使用 React 组件。
26
+ icon: 📦
27
+ link: /zh/guide/use-mdx/components
28
+ - title: 内置全文搜索
29
+ details: 构建时自动生成全文搜索索引,提供开箱即用的全文搜索能力。
30
+ icon: 🎨
31
+ link: https://rspress.rs/zh/guide/advanced/custom-search
32
+ - title: AI 友好
33
+ details: 通过 SSG-MD 生成符合 llms.txt 规范的 llms.txt 和 Markdown 文件,让大语言模型更容易理解和使用你的文档。
34
+ icon: 🤖
35
+ link: https://rspress.rs/zh/guide/basic/ssg-md
36
+ - title: 静态站点生成
37
+ details: 在生产环境中自动构建为静态 HTML 文件,可以轻松部署到任意位置。
38
+ icon: 🌈
39
+ link: https://rspress.rs/zh/guide/basic/ssg
40
+ - title: 提供多种自定义能力
41
+ details: 通过扩展机制,你可以轻松扩展主题 UI 和构建流程。
42
+ icon: 🔥
43
+ link: https://rspress.rs/zh/guide/basic/custom-theme
44
+ ---
@@ -0,0 +1,37 @@
1
+ import * as path from 'node:path';
2
+ import { defineConfig } from '@rspress/core';
3
+
4
+ export default defineConfig({
5
+ root: path.join(__dirname, 'docs'),
6
+ title: 'My Site',
7
+ description: 'A multilingual Rspress documentation site.',
8
+ lang: 'en',
9
+ icon: '/rspress-icon.png',
10
+ logo: {
11
+ light: '/rspress-light-logo.png',
12
+ dark: '/rspress-dark-logo.png',
13
+ },
14
+ locales: [
15
+ {
16
+ lang: 'en',
17
+ label: 'English',
18
+ title: 'My Site',
19
+ description: 'A multilingual Rspress documentation site.',
20
+ },
21
+ {
22
+ lang: 'zh',
23
+ label: '简体中文',
24
+ title: '我的站点',
25
+ description: '一个多语言 Rspress 文档站点。',
26
+ },
27
+ ],
28
+ themeConfig: {
29
+ socialLinks: [
30
+ {
31
+ icon: 'github',
32
+ mode: 'link',
33
+ content: 'https://github.com/web-infra-dev/rspress',
34
+ },
35
+ ],
36
+ },
37
+ });
@@ -0,0 +1,16 @@
1
+ [
2
+ {
3
+ "text": "Guide",
4
+ "link": "/guide/start/introduction",
5
+ "activeMatch": "/guide/"
6
+ },
7
+ {
8
+ "text": "API",
9
+ "link": "/api/",
10
+ "activeMatch": "/api/"
11
+ },
12
+ {
13
+ "text": "Document",
14
+ "link": "https://rspress.rs/"
15
+ }
16
+ ]
@@ -0,0 +1 @@
1
+ ["index", "commands"]
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: Command reference for Rspress development, production build, and local preview scripts.
3
+ ---
4
+
5
+ # Commands
6
+
7
+ ## dev
8
+
9
+ ## build
10
+
11
+ ## preview
@@ -0,0 +1,7 @@
1
+ ---
2
+ title: API Overview
3
+ description: Overview page for the Rspress starter API section and available reference pages.
4
+ overview: true
5
+ ---
6
+
7
+ This is an API Overview page which outlines all the available APIs.
@@ -0,0 +1,12 @@
1
+ [
2
+ {
3
+ "type": "dir-section-header",
4
+ "name": "start",
5
+ "label": "Getting Started"
6
+ },
7
+ {
8
+ "type": "dir-section-header",
9
+ "name": "use-mdx",
10
+ "label": "Markdown & MDX"
11
+ }
12
+ ]
@@ -0,0 +1 @@
1
+ ["introduction", "getting-started"]
@@ -0,0 +1,55 @@
1
+ ---
2
+ description: Set up an Rspress project, run local development, build production output, and choose next docs topics.
3
+ ---
4
+
5
+ # Getting started
6
+
7
+ ## Project structure
8
+
9
+ After creating a project with `create-rspress`, you will get the following project structure:
10
+
11
+ - `docs/` — The documentation source directory, configured via `root` in `rspress.config.ts`.
12
+ - `docs/_nav.json` — The navigation bar configuration.
13
+ - `docs/guide/_meta.json` — The sidebar configuration for the guide section.
14
+ - `docs/public/` — Static assets directory.
15
+ - `theme/` — Optional custom theme directory, generated when you choose the custom theme scaffold.
16
+ - `rspress.config.ts` — The Rspress configuration file.
17
+
18
+ ## Development
19
+
20
+ Start the local development server:
21
+
22
+ ```bash
23
+ npm run dev
24
+ ```
25
+
26
+ :::tip
27
+
28
+ You can specify the port number or host with `--port` or `--host`, such as `rspress dev --port 8080 --host 0.0.0.0`.
29
+
30
+ :::
31
+
32
+ ## Production build
33
+
34
+ Build the site for production:
35
+
36
+ ```bash
37
+ npm run build
38
+ ```
39
+
40
+ By default, Rspress will output to `doc_build` directory.
41
+
42
+ ## Preview
43
+
44
+ Preview the production build locally:
45
+
46
+ ```bash
47
+ npm run preview
48
+ ```
49
+
50
+ ## Next steps
51
+
52
+ - Learn how to use [MDX & React Components](/guide/use-mdx/components) in your docs.
53
+ - Learn about [Code Blocks](/guide/use-mdx/code-blocks/) syntax highlighting and line highlighting.
54
+ - Learn about [Custom Containers](/guide/use-mdx/container) for tips, warnings, and more.
55
+ - Explore the full [Rspress documentation](https://rspress.rs/) for advanced features.
@@ -0,0 +1,19 @@
1
+ ---
2
+ description: Introduction to Rspress features, including build performance, AI-native output, MDX, and extensibility.
3
+ ---
4
+
5
+ # Introduction
6
+
7
+ Rspress is a static site generator based on [Rsbuild](https://rsbuild.rs/), rendered with the React framework. It comes with a default documentation theme, and you can quickly build a documentation site with Rspress.
8
+
9
+ ## Why Rspress
10
+
11
+ - **Build Performance**. The core compilation module is based on the Rust front-end toolchain, providing millisecond-level startup and a more ultimate development experience.
12
+ - **AI-native**. Technical documentation not only serves human readers but can also be better understood and utilized by AI through SSG-MD.
13
+ - **MDX Support**. MDX is a powerful way to write content, allowing you to use React components in Markdown.
14
+ - **Basic Capabilities**. Including full-text search, internationalization, multi-version support, component library documentation, etc.
15
+ - **Extensibility**. Provides a built-in plugin system, supports extending Rspress through plugin API.
16
+
17
+ ## Try Rspress
18
+
19
+ Go to [Getting Started](/guide/start/getting-started) to learn how to use Rspress to build a documentation site.
@@ -0,0 +1 @@
1
+ ["components", { "type": "dir", "name": "code-blocks" }, "container"]