Skip to content

Commit

Permalink
perf(theme): default page title
Browse files Browse the repository at this point in the history
  • Loading branch information
pengzhanbo committed Sep 10, 2024
1 parent be47414 commit ab7d368
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions theme/src/node/config/resolveLocaleOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const FALLBACK_OPTIONS: PlumeThemeLocaleData = {
navbarSocialInclude: ['github', 'twitter', 'discord', 'facebook'],
aside: true,
outline: [2, 3],
externalLinkIcon: true,

// page meta
editLink: true,
Expand Down
6 changes: 4 additions & 2 deletions theme/src/node/plugins/markdown-title.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
},
Expand Down

0 comments on commit ab7d368

Please sign in to comment.