Skip to content

Commit 88d57a9

Browse files
authored
fix: allow overriding title if home is true (#493)
1 parent eabf6d2 commit 88d57a9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/node/markdownToVue.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,12 @@ function genPageDataCode(tags: string[], data: PageData) {
191191
}
192192

193193
const inferTitle = (frontmatter: any, content: string) => {
194-
if (frontmatter.home) {
195-
return 'Home'
196-
}
197194
if (frontmatter.title) {
198195
return deeplyParseHeader(frontmatter.title)
199196
}
197+
if (frontmatter.home) {
198+
return 'Home'
199+
}
200200
const match = content.match(/^\s*#+\s+(.*)/m)
201201
if (match) {
202202
return deeplyParseHeader(match[1].trim())

0 commit comments

Comments
 (0)