@rspress/core 1.6.1 → 1.7.0
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.
- package/dist/index.js +37 -44
- package/dist/index.js.map +1 -1
- package/dist/loader.d.ts +2 -1
- package/dist/loader.js +7 -4
- package/dist/loader.js.map +1 -1
- package/dist/runtime/App.js +3 -5
- package/package.json +11 -11
- package/src/runtime/App.tsx +7 -8
package/dist/runtime/App.js
CHANGED
|
@@ -28,13 +28,11 @@ async function initPageData(routePath) {
|
|
|
28
28
|
return isEqualPath(normalize(page.routePath), normalize(routePath));
|
|
29
29
|
});
|
|
30
30
|
const encodedPagePath = encodeURIComponent(pagePath);
|
|
31
|
-
|
|
32
|
-
// eslint-disable-next-line prefer-const
|
|
31
|
+
const {
|
|
33
32
|
toc = [],
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
title = "",
|
|
34
|
+
frontmatter
|
|
36
35
|
} = mod.default.__RSPRESS_PAGE_META?.[encodedPagePath] || {};
|
|
37
|
-
const frontmatter = mod.frontmatter || {};
|
|
38
36
|
return {
|
|
39
37
|
siteData,
|
|
40
38
|
page: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspress/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "The Rspress Documentation Framework",
|
|
5
5
|
"bugs": "https://github.com/web-infra-dev/rspress/issues",
|
|
6
6
|
"repository": {
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"@mdx-js/mdx": "2.2.1",
|
|
42
42
|
"@mdx-js/react": "2.2.1",
|
|
43
43
|
"@modern-js/utils": "2.40.0",
|
|
44
|
-
"@rsbuild/core": "0.0.
|
|
45
|
-
"@rsbuild/plugin-react": "0.0.
|
|
46
|
-
"@rsbuild/plugin-svgr": "0.0.
|
|
44
|
+
"@rsbuild/core": "0.0.24",
|
|
45
|
+
"@rsbuild/plugin-react": "0.0.24",
|
|
46
|
+
"@rsbuild/plugin-svgr": "0.0.24",
|
|
47
47
|
"@rspress/mdx-rs": "0.4.1",
|
|
48
48
|
"@types/compression": "^1.7.2",
|
|
49
49
|
"@types/polka": "^0.5.4",
|
|
@@ -91,13 +91,13 @@
|
|
|
91
91
|
"unist-util-visit": "^4.1.1",
|
|
92
92
|
"unist-util-visit-children": "^2.0.1",
|
|
93
93
|
"yaml-front-matter": "^4.1.1",
|
|
94
|
-
"@rspress/
|
|
95
|
-
"@rspress/
|
|
96
|
-
"@rspress/plugin-
|
|
97
|
-
"@rspress/plugin-
|
|
98
|
-
"@rspress/plugin-auto-nav-sidebar": "1.
|
|
99
|
-
"@rspress/
|
|
100
|
-
"@rspress/shared": "1.
|
|
94
|
+
"@rspress/runtime": "1.7.0",
|
|
95
|
+
"@rspress/plugin-medium-zoom": "1.7.0",
|
|
96
|
+
"@rspress/plugin-last-updated": "1.7.0",
|
|
97
|
+
"@rspress/plugin-container-syntax": "1.7.0",
|
|
98
|
+
"@rspress/plugin-auto-nav-sidebar": "1.7.0",
|
|
99
|
+
"@rspress/theme-default": "1.7.0",
|
|
100
|
+
"@rspress/shared": "1.7.0"
|
|
101
101
|
},
|
|
102
102
|
"devDependencies": {
|
|
103
103
|
"@modern-js/plugin-tailwindcss": "2.40.0",
|
package/src/runtime/App.tsx
CHANGED
|
@@ -20,6 +20,7 @@ type RspressPageMeta = Record<
|
|
|
20
20
|
{
|
|
21
21
|
title: string;
|
|
22
22
|
toc: Header[];
|
|
23
|
+
frontmatter: Record<string, any>;
|
|
23
24
|
}
|
|
24
25
|
>;
|
|
25
26
|
|
|
@@ -43,16 +44,14 @@ export async function initPageData(routePath: string): Promise<PageData> {
|
|
|
43
44
|
// FIXME: when sidebar item is configured as link string, the sidebar text won't updated when page title changed
|
|
44
45
|
// Reason: The sidebar item text depends on pageData, which is not updated when page title changed, because the pageData is computed once when build
|
|
45
46
|
const encodedPagePath = encodeURIComponent(pagePath);
|
|
46
|
-
|
|
47
|
-
// eslint-disable-next-line prefer-const
|
|
47
|
+
const {
|
|
48
48
|
toc = [],
|
|
49
|
-
// eslint-disable-next-line prefer-const
|
|
50
|
-
title = '',
|
|
51
|
-
} =
|
|
52
|
-
(mod.default.__RSPRESS_PAGE_META as RspressPageMeta)?.[encodedPagePath] ||
|
|
53
|
-
{};
|
|
54
49
|
|
|
55
|
-
|
|
50
|
+
title = '',
|
|
51
|
+
frontmatter,
|
|
52
|
+
} = (mod.default.__RSPRESS_PAGE_META as RspressPageMeta)?.[
|
|
53
|
+
encodedPagePath
|
|
54
|
+
] || {};
|
|
56
55
|
|
|
57
56
|
return {
|
|
58
57
|
siteData,
|