fix: allow overriding title if home is true (#493)

pull/498/head
Divyansh Singh 3 years ago committed by GitHub
parent eabf6d2aa6
commit 88d57a93ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -191,12 +191,12 @@ function genPageDataCode(tags: string[], data: PageData) {
}
const inferTitle = (frontmatter: any, content: string) => {
if (frontmatter.home) {
return 'Home'
}
if (frontmatter.title) {
return deeplyParseHeader(frontmatter.title)
}
if (frontmatter.home) {
return 'Home'
}
const match = content.match(/^\s*#+\s+(.*)/m)
if (match) {
return deeplyParseHeader(match[1].trim())

Loading…
Cancel
Save