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