Skip to content

Commit a1cbec7

Browse files
committed
fix: remove invalid frontmatter.title
1 parent 76602bc commit a1cbec7

File tree

3 files changed

+212
-271
lines changed

3 files changed

+212
-271
lines changed

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",

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,

0 commit comments

Comments
 (0)