Skip to content

Commit d6202b7

Browse files
authored
fix: remove invalid frontmatter.title (#73)
1 parent 76602bc commit d6202b7

File tree

8 files changed

+249
-292
lines changed

8 files changed

+249
-292
lines changed

.changeset/silly-owls-whisper.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@alauda/doom": patch
3+
---
4+
5+
fix: remove invalid `frontmatter.title`, bump rspress to v2.0.0-beta.11

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,22 +58,22 @@
5858
},
5959
"dependencies": {
6060
"@cspell/eslint-plugin": "^8.19.4 || ^9.0.2",
61-
"@eslint-react/eslint-plugin": "^1.51.0",
61+
"@eslint-react/eslint-plugin": "^1.51.1",
6262
"@inquirer/prompts": "^7.5.3",
6363
"@openapi-contrib/openapi-schema-to-json-schema": "^5.1.0",
6464
"@playwright/browser-chromium": "^1.52.0",
6565
"@rsbuild/plugin-sass": "^1.3.2",
6666
"@rsbuild/plugin-yaml": "^1.0.2",
67-
"@rspress/core": "2.0.0-beta.10",
68-
"@rspress/plugin-algolia": "2.0.0-beta.10",
69-
"@rspress/plugin-llms": "^2.0.0-beta.10",
70-
"@shikijs/transformers": "^3.5.0",
67+
"@rspress/core": "2.0.0-beta.11",
68+
"@rspress/plugin-algolia": "2.0.0-beta.11",
69+
"@rspress/plugin-llms": "^2.0.0-beta.11",
70+
"@shikijs/transformers": "^3.6.0",
7171
"chokidar": "^4.0.3",
7272
"cli-progress": "^3.12.0",
7373
"clsx": "^2.1.1",
7474
"commander": "^13.1.0 || ^14.0.0",
7575
"ejs": "^3.1.10",
76-
"es-toolkit": "^1.39.0",
76+
"es-toolkit": "^1.39.1",
7777
"eslint": "^9.28.0",
7878
"eslint-plugin-mdx": "^3.4.2",
7979
"html-tag-names": "^2.1.0",
@@ -94,7 +94,7 @@
9494
"remark-mdx": "^3.1.0",
9595
"remark-stringify": "^11.0.0",
9696
"shiki": "^3.6.0",
97-
"simple-git": "^3.27.0",
97+
"simple-git": "^3.28.0",
9898
"swagger2openapi": "^7.0.8",
9999
"tinyglobby": "^0.2.14",
100100
"type-fest": "^4.41.0",
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
diff --git a/node_modules/@rspress/theme-default/dist/index.d.ts b/node_modules/@rspress/theme-default/dist/index.d.ts
2+
index 770226b..f8c4be3 100644
3+
--- a/node_modules/@rspress/theme-default/dist/index.d.ts
4+
+++ b/node_modules/@rspress/theme-default/dist/index.d.ts
5+
@@ -566,4 +566,4 @@ export declare function useSidebarData(): SidebarData;
6+
*/
7+
export declare const useThemeState: () => readonly [ThemeValue, (value: ThemeValue, storeValue?: ThemeConfigValue) => void];
8+
9+
-export { }
10+
+export declare function renderInlineMarkdown(text: string): { children: string | null } | { dangerouslySetInnerHTML: { __html: string } }

src/cli/translate.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,10 @@ export const translateCommand = new Command('translate')
411411
newFrontmatter.title = sourceFrontmatter.i18n.title[target]
412412
}
413413

414+
if (typeof newFrontmatter.title !== 'string') {
415+
delete newFrontmatter.title
416+
}
417+
414418
targetContent = matter.stringify(
415419
content.startsWith('\n') ? content : '\n' + content,
416420
newFrontmatter,

src/runtime/components/ExternalSiteLink.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ const ExternalSiteLink_ = ({
7575
}
7676
target="_blank"
7777
rel="noopener noreferrer"
78-
className={clsx(classes.link, 'cursor-pointer', className)}
78+
className={clsx(classes.link, 'rp-cursor-pointer', className)}
7979
{...props}
8080
/>
8181
)

src/runtime/components/K8sCrd.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,23 +131,22 @@ export const K8sCrdSchema = ({
131131
return (
132132
<>
133133
<Markdown>{description}</Markdown>
134-
<div className="flex items-center">
134+
<div className="rp-flex rp-items-center">
135135
<span>
136136
<code>{version}</code> <Badge>version</Badge>
137137
</span>
138138
{!isPrint && properties != null && (
139139
<Button
140-
className="ml-auto doom-btn"
140+
className="rp-ml-auto doom-btn"
141141
type="button"
142-
text={
143-
<span onClick={toggleExpandAll}>
144-
{expandAll ? '-' : '+'}{' '}
145-
{t(expandAll ? 'collapse_all' : 'expand_all')}
146-
</span>
147-
}
148142
size="medium"
149143
theme="alt"
150-
></Button>
144+
>
145+
<span onClick={toggleExpandAll}>
146+
{expandAll ? '-' : '+'}{' '}
147+
{t(expandAll ? 'collapse_all' : 'expand_all')}
148+
</span>
149+
</Button>
151150
)}
152151
</div>
153152
{properties == null ? (

src/runtime/components/Overview.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -203,40 +203,42 @@ export function Overview(props: {
203203
const groups = customGroups ?? defaultGroups
204204

205205
return (
206-
<div className="overview-index doom-overview-index mx-auto">
206+
<div className="overview-index doom-overview-index rp-mx-auto">
207207
{content}
208208
{groups.map((group) => (
209209
<Fragment key={group.name}>
210210
{/* If there is no sidebar group, we show the sidebar items directly and hide the group name */}
211211
{(!title || [title, defaultGroupTitle].includes(group.name)) &&
212212
groups.length === 1 ? (
213-
<h2 style={{ paddingTop: 0 }}></h2>
213+
<h2 style={{ paddingTop: 0 }} />
214214
) : (
215-
<h2>{renderInlineMarkdown(group.name)}</h2>
215+
<h2 {...renderInlineMarkdown(group.name)} />
216216
)}
217217

218218
<div className={classes.overviewGroups}>
219219
{group.items.map((item) => (
220220
<div className={classes.overviewGroup} key={item.link}>
221221
<h3 style={{ marginBottom: 8 }}>
222-
<Link href={normalizeHref(item.link)}>
223-
{renderInlineMarkdown(item.text)}
224-
</Link>
222+
<Link
223+
href={normalizeHref(item.link)}
224+
{...renderInlineMarkdown(item.text)}
225+
/>
225226
</h3>
226227
<div className={classes.overviewDescription}>
227228
{item.description}
228229
</div>
229-
<ul className="list-none">
230+
<ul className="rp-list-none">
230231
{item.headers?.map((header) => (
231232
<li
232233
key={header.id}
233234
className={`${classes.overviewGroupLi} ${
234235
classes[`level${header.depth}`]
235-
} first:mt-2`}
236+
} first:rp-mt-2`}
236237
>
237-
<Link href={`${normalizeHref(item.link)}#${header.id}`}>
238-
{renderInlineMarkdown(header.text)}
239-
</Link>
238+
<Link
239+
href={`${normalizeHref(item.link)}#${header.id}`}
240+
{...renderInlineMarkdown(header.text)}
241+
/>
240242
</li>
241243
))}
242244
</ul>

0 commit comments

Comments
 (0)