Skip to content

Commit 56d7409

Browse files
authored
docs: update some configurations of Rspress v2 (#1339)
1 parent 3ea0364 commit 56d7409

File tree

7 files changed

+28
-40
lines changed

7 files changed

+28
-40
lines changed

website/docs/en/blog/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: Overview
33
sidebar: false
4+
pageType: doc-wide
45
---
56

67
# Rslib blogs

website/docs/en/blog/introducing-rslib.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
date: 2025-05-14 10:00:00
33
sidebar: false
4+
pageType: doc-wide
45
---
56

67
_May 14, 2025_

website/docs/en/guide/advanced/output-compatibility.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,6 @@ export default defineConfig({
102102
1. Configure `output.external` with `resolvedPolyfillToModules`, which you can import from [@rsbuild/plugin-node-polyfill](https://github.com/rspack-contrib/rsbuild-plugin-node-polyfill). This will externalize the polyfill modules to the installed polyfill dependencies.
103103
2. Install used polyfill modules as dependencies.
104104

105-
With the following steps, every usage of the polyfill module will be replaced by the corresponding module in the `externals` field. Checkout the <SourceCode href="https://github.com/web-infra-dev/rslib/blob/main/tests/integration/node-polyfill/bundle-false/rslib.config.ts" /> of the example for more details.
105+
With the above steps, every usage of the polyfill module will be replaced by the corresponding module in the `externals` field. Checkout the <SourceCode href="https://github.com/web-infra-dev/rslib/blob/main/tests/integration/node-polyfill/bundle-false/rslib.config.ts" /> of the example for more details.
106106

107107
Check out the documentation of [@rsbuild/plugin-node-polyfill](https://github.com/rspack-contrib/rsbuild-plugin-node-polyfill), all the configurations are applicable for Rslib.

website/docs/zh/blog/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: 总览
33
sidebar: false
4+
pageType: doc-wide
45
---
56

67
# Rslib 博客

website/docs/zh/blog/introducing-rslib.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
date: 2025-05-14 10:00:00
33
sidebar: false
4+
pageType: doc-wide
45
---
56

67
_2025 年 5 月 14 日_

website/docs/zh/guide/advanced/output-compatibility.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,6 @@ export default defineConfig({
102102
1. 配置 `output.external``resolvedPolyfillToModules`,你可以从 [@rsbuild/plugin-node-polyfill](https://github.com/rspack-contrib/rsbuild-plugin-node-polyfill) 导入。这将 polyfill 模块 external 到已安装的 polyfill 依赖中。
103103
2. 安装使用的 polyfill 模块作为依赖。
104104

105-
通过以下步骤,每个 polyfill 模块的使用将被替换为 `externals` 字段中的相应模块。更多详细信息,请查看 <SourceCode href="https://github.com/web-infra-dev/rslib/blob/main/tests/integration/node-polyfill/bundle-false/rslib.config.ts" /> 的示例。
105+
通过以上步骤,每个 polyfill 模块的使用将被替换为 `externals` 字段中的相应模块。更多详细信息,请查看 <SourceCode href="https://github.com/web-infra-dev/rslib/blob/main/tests/integration/node-polyfill/bundle-false/rslib.config.ts" /> 的示例。
106106

107107
更多详细信息,请查看 [@rsbuild/plugin-node-polyfill](https://github.com/rspack-contrib/rsbuild-plugin-node-polyfill) 文档,所有配置均适用于 Rslib。

website/rspress.config.ts

Lines changed: 22 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,25 @@ import { pluginFontOpenSans } from 'rspress-plugin-font-open-sans';
1616

1717
const siteUrl = 'https://rslib.rs';
1818
const description = 'The Rsbuild-based library development tool';
19+
const descriptionZh = '基于 Rsbuild 的库构建工具';
1920

2021
export default defineConfig({
22+
title: 'Rslib',
23+
description:
24+
'Rslib is a library development tool that leverages the well-designed configurations and plugins of Rsbuild.',
25+
lang: 'en',
26+
icon: 'https://assets.rspack.rs/rslib/rslib-logo-192x192.png',
27+
logo: 'https://assets.rspack.rs/rslib/rslib-logo-192x192.png',
28+
logoText: 'Rslib',
29+
root: path.join(__dirname, 'docs'),
30+
markdown: {
31+
shiki: {
32+
transformers: [transformerNotationHighlight(), transformerNotationDiff()],
33+
},
34+
},
35+
search: {
36+
codeBlocks: true,
37+
},
2138
plugins: [
2239
pluginAlgolia(),
2340
pluginFontOpenSans(),
@@ -52,22 +69,6 @@ export default defineConfig({
5269
siteUrl,
5370
}),
5471
],
55-
root: path.join(__dirname, 'docs'),
56-
lang: 'en',
57-
title: 'Rslib',
58-
description:
59-
'Rslib is a library development tool that leverages the well-designed configurations and plugins of Rsbuild.',
60-
icon: 'https://assets.rspack.rs/rslib/rslib-logo-192x192.png',
61-
logo: 'https://assets.rspack.rs/rslib/rslib-logo-192x192.png',
62-
logoText: 'Rslib',
63-
markdown: {
64-
shiki: {
65-
transformers: [transformerNotationHighlight(), transformerNotationDiff()],
66-
},
67-
},
68-
search: {
69-
codeBlocks: true,
70-
},
7172
route: {
7273
cleanUrls: true,
7374
// exclude document fragments from routes
@@ -102,39 +103,22 @@ export default defineConfig({
102103
content: 'https://discord.gg/XsaKEEk4mW',
103104
},
104105
],
106+
editLink: {
107+
docRepoBaseUrl:
108+
'https://github.com/web-infra-dev/rslib/tree/main/website/docs',
109+
},
105110
locales: [
106111
{
107112
lang: 'en',
108113
label: 'English',
109114
title: 'Rslib',
110115
description,
111-
editLink: {
112-
docRepoBaseUrl:
113-
'https://github.com/web-infra-dev/rslib/tree/main/website/docs',
114-
text: '📝 Edit this page on GitHub',
115-
},
116116
},
117117
{
118118
lang: 'zh',
119119
label: '简体中文',
120120
title: 'Rslib',
121-
outlineTitle: '目录',
122-
prevPageText: '上一页',
123-
nextPageText: '下一页',
124-
searchPlaceholderText: '搜索文档',
125-
searchNoResultsText: '无法找到相关搜索结果',
126-
searchSuggestedQueryText: '请使用不同的关键字重试',
127-
description: '基于 Rsbuild 的库构建工具',
128-
overview: {
129-
filterNameText: '过滤',
130-
filterPlaceholderText: '输入关键词',
131-
filterNoResultText: '未找到匹配的 API',
132-
},
133-
editLink: {
134-
docRepoBaseUrl:
135-
'https://github.com/web-infra-dev/rslib/tree/main/website/docs',
136-
text: '📝 在 GitHub 上编辑此页',
137-
},
121+
description: descriptionZh,
138122
},
139123
],
140124
},

0 commit comments

Comments
 (0)