|
|
@ -37,9 +37,15 @@ export function useUpdateHead(route: Route, siteDataByRouteRef: Ref<SiteData>) {
|
|
|
|
// update title and description
|
|
|
|
// update title and description
|
|
|
|
document.title = createTitle(siteData, pageData)
|
|
|
|
document.title = createTitle(siteData, pageData)
|
|
|
|
|
|
|
|
|
|
|
|
document
|
|
|
|
const description = pageDescription || siteData.description
|
|
|
|
.querySelector(`meta[name=description]`)!
|
|
|
|
let metaDescriptionElement = document.querySelector(
|
|
|
|
.setAttribute('content', pageDescription || siteData.description)
|
|
|
|
`meta[name=description]`
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
if (metaDescriptionElement) {
|
|
|
|
|
|
|
|
metaDescriptionElement.setAttribute('content', description)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
createHeadElement(['meta', { name: 'description', content: description }])
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
updateHeadTags(
|
|
|
|
updateHeadTags(
|
|
|
|
mergeHead(siteData.head, filterOutHeadDescription(frontmatterHead))
|
|
|
|
mergeHead(siteData.head, filterOutHeadDescription(frontmatterHead))
|
|
|
|