perf(theme): default page title

This commit is contained in:
pengzhanbo 2024-09-10 16:47:18 +08:00
parent be47414c16
commit ab7d368485
2 changed files with 5 additions and 2 deletions

View File

@ -23,6 +23,7 @@ const FALLBACK_OPTIONS: PlumeThemeLocaleData = {
navbarSocialInclude: ['github', 'twitter', 'discord', 'facebook'],
aside: true,
outline: [2, 3],
externalLinkIcon: true,
// page meta
editLink: true,

View File

@ -21,8 +21,10 @@ export function markdownTitlePlugin(): Plugin {
})
source = `${matter}\n${content}`
const result = render(source, env)
if (title)
env.title = title
if (title) {
env.frontmatter ??= {}
env.frontmatter.title ??= title
}
return result
}
},