feat(theme): extend titleTemplate by replacing the title (#1200)

pull/1205/head
Sascha 2 years ago committed by GitHub
parent 4595383789
commit c7def730c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -104,6 +104,11 @@ export function resolveSiteDataByRoute(
export function createTitle(siteData: SiteData, pageData: PageData): string {
const title = pageData.title || siteData.title
const template = pageData.titleTemplate ?? siteData.titleTemplate
if (typeof template === 'string' && template.includes(':title')) {
return template.replace(/:title/g, title)
}
const templateString = createTitleTemplate(siteData.title, template)
return `${title}${templateString}`

Loading…
Cancel
Save