|
|
@ -104,6 +104,11 @@ export function resolveSiteDataByRoute(
|
|
|
|
export function createTitle(siteData: SiteData, pageData: PageData): string {
|
|
|
|
export function createTitle(siteData: SiteData, pageData: PageData): string {
|
|
|
|
const title = pageData.title || siteData.title
|
|
|
|
const title = pageData.title || siteData.title
|
|
|
|
const template = pageData.titleTemplate ?? siteData.titleTemplate
|
|
|
|
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)
|
|
|
|
const templateString = createTitleTemplate(siteData.title, template)
|
|
|
|
|
|
|
|
|
|
|
|
return `${title}${templateString}`
|
|
|
|
return `${title}${templateString}`
|
|
|
|