perf(theme): default page title
This commit is contained in:
parent
be47414c16
commit
ab7d368485
@ -23,6 +23,7 @@ const FALLBACK_OPTIONS: PlumeThemeLocaleData = {
|
||||
navbarSocialInclude: ['github', 'twitter', 'discord', 'facebook'],
|
||||
aside: true,
|
||||
outline: [2, 3],
|
||||
externalLinkIcon: true,
|
||||
|
||||
// page meta
|
||||
editLink: true,
|
||||
|
||||
@ -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
|
||||
}
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user