From 144b78e212bc5c6cadbba8ae5a06864225a31f43 Mon Sep 17 00:00:00 2001
From: Timeless0911 <1604889533@qq.com>
Date: Mon, 17 Nov 2025 19:55:00 +0800
Subject: [PATCH 1/4] docs: refactor section headers
---
website/docs/en/config/_meta.json | 14 +--
website/docs/en/config/index.mdx | 7 +-
website/docs/en/config/lib/_meta.json | 19 +++--
website/docs/en/config/lib/index.mdx | 17 ++--
website/docs/en/config/rsbuild/_meta.json | 1 +
website/docs/en/config/rsbuild/index.mdx | 10 +--
website/docs/en/guide/_meta.json | 14 +--
website/docs/en/guide/solution/_meta.json | 2 +-
website/docs/en/guide/solution/index.mdx | 2 +-
website/docs/zh/config/_meta.json | 10 +--
website/docs/zh/config/index.mdx | 5 +-
website/docs/zh/config/lib/_meta.json | 19 +++--
website/docs/zh/config/lib/index.mdx | 17 ++--
website/docs/zh/config/rsbuild/_meta.json | 1 +
website/docs/zh/config/rsbuild/index.mdx | 12 ++-
website/docs/zh/guide/_meta.json | 12 +--
website/docs/zh/guide/solution/_meta.json | 2 +-
website/docs/zh/guide/solution/index.mdx | 2 +-
website/theme/components/Overview.module.scss | 61 -------------
website/theme/components/Overview.tsx | 85 ++++++++++++-------
20 files changed, 146 insertions(+), 166 deletions(-)
delete mode 100644 website/theme/components/Overview.module.scss
diff --git a/website/docs/en/config/_meta.json b/website/docs/en/config/_meta.json
index 57a840dbf..8bb1b9f50 100644
--- a/website/docs/en/config/_meta.json
+++ b/website/docs/en/config/_meta.json
@@ -1,17 +1,17 @@
[
{
- "type": "file",
- "name": "index",
- "label": "Config Overview"
+ "type": "section-header",
+ "label": "Overview"
},
+ "index",
{
- "type": "dir",
+ "type": "dir-section-header",
"name": "lib",
- "label": "Lib Configurations"
+ "label": "Lib configurations"
},
{
- "type": "dir",
+ "type": "dir-section-header",
"name": "rsbuild",
- "label": "Rsbuild Configurations"
+ "label": "Rsbuild configurations"
}
]
diff --git a/website/docs/en/config/index.mdx b/website/docs/en/config/index.mdx
index 0a97215eb..03b51e5d6 100644
--- a/website/docs/en/config/index.mdx
+++ b/website/docs/en/config/index.mdx
@@ -1,6 +1,9 @@
---
-overview: true
-title: Config Overview
+title: Config overview
---
This page lists all the configurations for Rslib. See [Configure Rslib](/guide/basic/configure-rslib) for detail.
+
+import Overview from '@components/Overview';
+
+
diff --git a/website/docs/en/config/lib/_meta.json b/website/docs/en/config/lib/_meta.json
index a01f0aa0e..179cea44a 100644
--- a/website/docs/en/config/lib/_meta.json
+++ b/website/docs/en/config/lib/_meta.json
@@ -1,17 +1,18 @@
[
- "format",
- "bundle",
+ "index",
"auto-extension",
"auto-external",
- "redirect",
- "syntax",
- "external-helpers",
"banner",
- "footer",
+ "bundle",
"dts",
- "shims",
+ "experiments",
+ "external-helpers",
+ "format",
"id",
- "umd-name",
"out-base",
- "experiments"
+ "footer",
+ "redirect",
+ "shims",
+ "syntax",
+ "umd-name"
]
diff --git a/website/docs/en/config/lib/index.mdx b/website/docs/en/config/lib/index.mdx
index 42fdb253a..33815ebb9 100644
--- a/website/docs/en/config/lib/index.mdx
+++ b/website/docs/en/config/lib/index.mdx
@@ -1,20 +1,23 @@
-# Lib configurations
+# Overview
- **Type:**
```ts
interface LibConfig extends EnvironmentConfig {
- format?: Format;
- bundle?: boolean;
autoExtension?: boolean;
autoExternal?: AutoExternal;
- redirect?: Redirect;
- syntax?: Syntax;
- externalHelpers?: boolean;
banner?: BannerAndFooter;
+ bundle?: boolean;
+ dts?: Dts;
+ experiments?: { advancedEsm?: boolean };
+ externalHelpers?: boolean;
+ format?: Format;
+ id?: string;
+ outBase?: string;
footer?: BannerAndFooter;
+ redirect?: Redirect;
shims?: Shims;
- dts?: Dts;
+ syntax?: Syntax;
umdName?: Rspack.LibraryName;
}
diff --git a/website/docs/en/config/rsbuild/_meta.json b/website/docs/en/config/rsbuild/_meta.json
index faa200631..b8729fd90 100644
--- a/website/docs/en/config/rsbuild/_meta.json
+++ b/website/docs/en/config/rsbuild/_meta.json
@@ -1,4 +1,5 @@
[
+ "index",
{
"type": "file",
"name": "log-level",
diff --git a/website/docs/en/config/rsbuild/index.mdx b/website/docs/en/config/rsbuild/index.mdx
index 1dfe277c5..af11b1511 100644
--- a/website/docs/en/config/rsbuild/index.mdx
+++ b/website/docs/en/config/rsbuild/index.mdx
@@ -1,13 +1,9 @@
import { RsbuildDocBadge } from '@components/RsbuildDocBadge';
-# Rsbuild configurations
+# Overview
Rslib inherits its configuration from Rsbuild, so you can also configure the options from Rsbuild. This chapter introduces some common configuration items and explains how to use them in Rslib.
-:::tip
-To learn more about Rslib configurations, check out [Configure Rslib](/guide/basic/configure-rslib).
-:::
-
## Overview
- [logLevel](/config/rsbuild/log-level): Specify the log level.
@@ -17,3 +13,7 @@ To learn more about Rslib configurations, check out [Configure Rslib](/guide/bas
- [tools](/config/rsbuild/tools): Options for low-level tools.
- [performance](/config/rsbuild/performance): Options for performance.
- [plugins](/config/rsbuild/plugins): Configure Rsbuild plugins.
+
+:::tip
+To learn more about Rslib configurations, check out [Configure Rslib](/guide/basic/configure-rslib).
+:::
diff --git a/website/docs/en/guide/_meta.json b/website/docs/en/guide/_meta.json
index 9f1f4b21d..960e03405 100644
--- a/website/docs/en/guide/_meta.json
+++ b/website/docs/en/guide/_meta.json
@@ -1,31 +1,31 @@
[
{
- "type": "dir",
+ "type": "dir-section-header",
"name": "start",
- "label": "Getting Started"
+ "label": "Start"
},
{
- "type": "dir",
+ "type": "dir-section-header",
"name": "solution",
"label": "Solution"
},
{
- "type": "dir",
+ "type": "dir-section-header",
"name": "basic",
"label": "Basic"
},
{
- "type": "dir",
+ "type": "dir-section-header",
"name": "advanced",
"label": "Advanced"
},
{
- "type": "dir",
+ "type": "dir-section-header",
"name": "migration",
"label": "Migration"
},
{
- "type": "dir",
+ "type": "dir-section-header",
"name": "faq",
"label": "FAQ"
}
diff --git a/website/docs/en/guide/solution/_meta.json b/website/docs/en/guide/solution/_meta.json
index bf48fec55..6e2697479 100644
--- a/website/docs/en/guide/solution/_meta.json
+++ b/website/docs/en/guide/solution/_meta.json
@@ -1 +1 @@
-["nodejs", "react", "vue"]
+["index", "nodejs", "react", "vue"]
diff --git a/website/docs/en/guide/solution/index.mdx b/website/docs/en/guide/solution/index.mdx
index 08aec6f06..ff7cbbf4a 100644
--- a/website/docs/en/guide/solution/index.mdx
+++ b/website/docs/en/guide/solution/index.mdx
@@ -1,4 +1,4 @@
-# Solution
+# Overview
In this chapter, we will introduce how to use Rslib to development libraries for browser and Node.js. We will also cover how to create libraries for different UI frameworks.
diff --git a/website/docs/zh/config/_meta.json b/website/docs/zh/config/_meta.json
index 67215f215..012db630f 100644
--- a/website/docs/zh/config/_meta.json
+++ b/website/docs/zh/config/_meta.json
@@ -1,16 +1,16 @@
[
{
- "type": "file",
- "name": "index",
- "label": "配置总览"
+ "type": "section-header",
+ "label": "总览"
},
+ "index",
{
- "type": "dir",
+ "type": "dir-section-header",
"name": "lib",
"label": "Lib 配置"
},
{
- "type": "dir",
+ "type": "dir-section-header",
"name": "rsbuild",
"label": "Rsbuild 配置"
}
diff --git a/website/docs/zh/config/index.mdx b/website/docs/zh/config/index.mdx
index 503af5c53..b6de95530 100644
--- a/website/docs/zh/config/index.mdx
+++ b/website/docs/zh/config/index.mdx
@@ -1,6 +1,9 @@
---
-overview: true
title: 配置总览
---
本页面列出了 Rslib 的所有配置项。详细配置请查阅 [配置 Rslib](/guide/basic/configure-rslib)。
+
+import Overview from '@components/Overview';
+
+
diff --git a/website/docs/zh/config/lib/_meta.json b/website/docs/zh/config/lib/_meta.json
index a01f0aa0e..179cea44a 100644
--- a/website/docs/zh/config/lib/_meta.json
+++ b/website/docs/zh/config/lib/_meta.json
@@ -1,17 +1,18 @@
[
- "format",
- "bundle",
+ "index",
"auto-extension",
"auto-external",
- "redirect",
- "syntax",
- "external-helpers",
"banner",
- "footer",
+ "bundle",
"dts",
- "shims",
+ "experiments",
+ "external-helpers",
+ "format",
"id",
- "umd-name",
"out-base",
- "experiments"
+ "footer",
+ "redirect",
+ "shims",
+ "syntax",
+ "umd-name"
]
diff --git a/website/docs/zh/config/lib/index.mdx b/website/docs/zh/config/lib/index.mdx
index 875599c50..343ed4c54 100644
--- a/website/docs/zh/config/lib/index.mdx
+++ b/website/docs/zh/config/lib/index.mdx
@@ -1,20 +1,23 @@
-# Lib 配置
+# 总览
- **类型:**
```ts
interface LibConfig extends EnvironmentConfig {
- format?: Format;
- bundle?: boolean;
autoExtension?: boolean;
autoExternal?: AutoExternal;
- redirect?: Redirect;
- syntax?: Syntax;
- externalHelpers?: boolean;
banner?: BannerAndFooter;
+ bundle?: boolean;
+ dts?: Dts;
+ experiments?: { advancedEsm?: boolean };
+ externalHelpers?: boolean;
+ format?: Format;
+ id?: string;
+ outBase?: string;
footer?: BannerAndFooter;
+ redirect?: Redirect;
shims?: Shims;
- dts?: Dts;
+ syntax?: Syntax;
umdName?: Rspack.LibraryName;
}
diff --git a/website/docs/zh/config/rsbuild/_meta.json b/website/docs/zh/config/rsbuild/_meta.json
index faa200631..b8729fd90 100644
--- a/website/docs/zh/config/rsbuild/_meta.json
+++ b/website/docs/zh/config/rsbuild/_meta.json
@@ -1,4 +1,5 @@
[
+ "index",
{
"type": "file",
"name": "log-level",
diff --git a/website/docs/zh/config/rsbuild/index.mdx b/website/docs/zh/config/rsbuild/index.mdx
index be1c18653..2380f8a94 100644
--- a/website/docs/zh/config/rsbuild/index.mdx
+++ b/website/docs/zh/config/rsbuild/index.mdx
@@ -1,15 +1,9 @@
import { RsbuildDocBadge } from '@components/RsbuildDocBadge';
-# Rsbuild 配置
+# 总览
Rslib 继承了 Rsbuild 的配置,所以你也可以配置 选项。本章节介绍了一些常见的配置项,并解释了如何在 Rslib 中使用它们。
-:::tip
-要了解更多关于 Rslib 的配置,请查看 [Configure Rslib](/guide/basic/configure-rslib)。
-:::
-
-## 概览
-
- [logLevel](/config/rsbuild/log-level): 指定日志级别。
- [resolve](/config/rsbuild/resolve): 与模块解析相关的选项。
- [source](/config/rsbuild/source): 与输入的源代码相关的选项。
@@ -17,3 +11,7 @@ Rslib 继承了 Rsbuild 的配置,所以你也可以配置 (
-
-
-
{group.name}
-
- {group.items.map((item) => (
- -
- {item.text}
-
- ))}
-
-
-
- ));
+ const group: Group = {
+ name: '',
+ items: OVERVIEW_GROUPS.map((item) => ({
+ text: item.name,
+ link: tUrl(item.link),
+ items: item.items.map(({ link, text }) => {
+ return {
+ link: tUrl(link),
+ text,
+ };
+ }),
+ })),
+ };
- return {Nodes}
;
+ return ;
}
From 2a0cfb3ce879531f03334c6b7ee574b83c410e76 Mon Sep 17 00:00:00 2001
From: Timeless0911 <1604889533@qq.com>
Date: Mon, 17 Nov 2025 19:57:57 +0800
Subject: [PATCH 2/4] chore: update
---
website/docs/en/config/index.mdx | 5 ++++-
website/docs/zh/config/index.mdx | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/website/docs/en/config/index.mdx b/website/docs/en/config/index.mdx
index 03b51e5d6..3ae0166e8 100644
--- a/website/docs/en/config/index.mdx
+++ b/website/docs/en/config/index.mdx
@@ -1,7 +1,10 @@
---
-title: Config overview
+pageType: doc-wide
+outline: false
---
+# Config overview
+
This page lists all the configurations for Rslib. See [Configure Rslib](/guide/basic/configure-rslib) for detail.
import Overview from '@components/Overview';
diff --git a/website/docs/zh/config/index.mdx b/website/docs/zh/config/index.mdx
index b6de95530..6093cedcf 100644
--- a/website/docs/zh/config/index.mdx
+++ b/website/docs/zh/config/index.mdx
@@ -1,7 +1,10 @@
---
-title: 配置总览
+pageType: doc-wide
+outline: false
---
+# 配置总览
+
本页面列出了 Rslib 的所有配置项。详细配置请查阅 [配置 Rslib](/guide/basic/configure-rslib)。
import Overview from '@components/Overview';
From ea0a9209d43991ed73829222b7e5a5536f0e678c Mon Sep 17 00:00:00 2001
From: Timeless0911 <1604889533@qq.com>
Date: Tue, 18 Nov 2025 11:33:21 +0800
Subject: [PATCH 3/4] chore: update
---
website/docs/en/config/lib/_meta.json | 2 +-
website/docs/en/config/lib/index.mdx | 2 +-
website/docs/en/config/rsbuild/index.mdx | 2 --
website/docs/zh/config/lib/_meta.json | 2 +-
4 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/website/docs/en/config/lib/_meta.json b/website/docs/en/config/lib/_meta.json
index 179cea44a..eecbd2023 100644
--- a/website/docs/en/config/lib/_meta.json
+++ b/website/docs/en/config/lib/_meta.json
@@ -7,10 +7,10 @@
"dts",
"experiments",
"external-helpers",
+ "footer",
"format",
"id",
"out-base",
- "footer",
"redirect",
"shims",
"syntax",
diff --git a/website/docs/en/config/lib/index.mdx b/website/docs/en/config/lib/index.mdx
index 33815ebb9..96a36813b 100644
--- a/website/docs/en/config/lib/index.mdx
+++ b/website/docs/en/config/lib/index.mdx
@@ -11,10 +11,10 @@ interface LibConfig extends EnvironmentConfig {
dts?: Dts;
experiments?: { advancedEsm?: boolean };
externalHelpers?: boolean;
+ footer?: BannerAndFooter;
format?: Format;
id?: string;
outBase?: string;
- footer?: BannerAndFooter;
redirect?: Redirect;
shims?: Shims;
syntax?: Syntax;
diff --git a/website/docs/en/config/rsbuild/index.mdx b/website/docs/en/config/rsbuild/index.mdx
index af11b1511..9bb1a1484 100644
--- a/website/docs/en/config/rsbuild/index.mdx
+++ b/website/docs/en/config/rsbuild/index.mdx
@@ -4,8 +4,6 @@ import { RsbuildDocBadge } from '@components/RsbuildDocBadge';
Rslib inherits its configuration from Rsbuild, so you can also configure the options from Rsbuild. This chapter introduces some common configuration items and explains how to use them in Rslib.
-## Overview
-
- [logLevel](/config/rsbuild/log-level): Specify the log level.
- [resolve](/config/rsbuild/resolve): Options for module resolution.
- [source](/config/rsbuild/source): Options for input source code.
diff --git a/website/docs/zh/config/lib/_meta.json b/website/docs/zh/config/lib/_meta.json
index 179cea44a..eecbd2023 100644
--- a/website/docs/zh/config/lib/_meta.json
+++ b/website/docs/zh/config/lib/_meta.json
@@ -7,10 +7,10 @@
"dts",
"experiments",
"external-helpers",
+ "footer",
"format",
"id",
"out-base",
- "footer",
"redirect",
"shims",
"syntax",
From fb1c31ec0509c663947ea2c95cede61f652ec93b Mon Sep 17 00:00:00 2001
From: Timeless0911 <1604889533@qq.com>
Date: Tue, 18 Nov 2025 12:40:04 +0800
Subject: [PATCH 4/4] chore: update
---
website/docs/en/blog/index.mdx | 1 -
website/docs/en/blog/introducing-rslib.mdx | 1 -
website/docs/zh/blog/index.mdx | 1 -
website/docs/zh/blog/introducing-rslib.mdx | 1 -
website/theme/index.scss | 8 ++++++++
5 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/website/docs/en/blog/index.mdx b/website/docs/en/blog/index.mdx
index 4d25aa6f9..388b6ebc9 100644
--- a/website/docs/en/blog/index.mdx
+++ b/website/docs/en/blog/index.mdx
@@ -1,7 +1,6 @@
---
title: Overview
sidebar: false
-pageType: doc-wide
---
# Rslib blogs
diff --git a/website/docs/en/blog/introducing-rslib.mdx b/website/docs/en/blog/introducing-rslib.mdx
index 1a1aa689e..5114161b4 100644
--- a/website/docs/en/blog/introducing-rslib.mdx
+++ b/website/docs/en/blog/introducing-rslib.mdx
@@ -1,7 +1,6 @@
---
date: 2025-05-14 10:00:00
sidebar: false
-pageType: doc-wide
---
_May 14, 2025_
diff --git a/website/docs/zh/blog/index.mdx b/website/docs/zh/blog/index.mdx
index 7901a0de7..4eb5eae99 100644
--- a/website/docs/zh/blog/index.mdx
+++ b/website/docs/zh/blog/index.mdx
@@ -1,7 +1,6 @@
---
title: 总览
sidebar: false
-pageType: doc-wide
---
# Rslib 博客
diff --git a/website/docs/zh/blog/introducing-rslib.mdx b/website/docs/zh/blog/introducing-rslib.mdx
index 8d397013a..3f9dc23c2 100644
--- a/website/docs/zh/blog/introducing-rslib.mdx
+++ b/website/docs/zh/blog/introducing-rslib.mdx
@@ -1,7 +1,6 @@
---
date: 2025-05-14 10:00:00
sidebar: false
-pageType: doc-wide
---
_2025 年 5 月 14 日_
diff --git a/website/theme/index.scss b/website/theme/index.scss
index 8f65735d0..d1bcf06df 100644
--- a/website/theme/index.scss
+++ b/website/theme/index.scss
@@ -11,3 +11,11 @@
.dark {
--rp-c-link: var(--rp-c-brand-light);
}
+
+/* Simulate the centering behavior when sidebar: false */
+/* Avoid having the visual center too far to the right */
+@media (min-width: 1280px) {
+ .rp-doc-layout__sidebar-placeholder {
+ width: 10vw !important;
+ }
+}