fix: update to upstream vitepress

Fixes WEB-25
This commit is contained in:
taskylizard 2024-09-01 15:12:33 +00:00
parent a7d86c439f
commit e337ab380f
No known key found for this signature in database
GPG key ID: 1820131ED1A24120
6 changed files with 356 additions and 260 deletions

View file

@ -20,6 +20,8 @@ export function generateMeta(context: TransformContext, hostname: string) {
const head: HeadConfig[] = []
const { pageData } = context
if (pageData.isNotFound) return head
const url = `${hostname}/${pageData.relativePath.replace(/((^|\/)index)?\.md$/, '$2')}`
head.push(
@ -30,6 +32,7 @@ export function generateMeta(context: TransformContext, hostname: string) {
['meta', { property: 'og:title', content: pageData.frontmatter.title }],
['meta', { name: 'twitter:title', content: pageData.frontmatter.title }]
)
if (pageData.frontmatter.description) {
head.push(
[
@ -48,6 +51,7 @@ export function generateMeta(context: TransformContext, hostname: string) {
]
)
}
if (pageData.frontmatter.image) {
head.push([
'meta',
@ -87,12 +91,14 @@ export function generateMeta(context: TransformContext, hostname: string) {
]
)
}
if (pageData.frontmatter.tag) {
head.push([
'meta',
{ property: 'article:tag', content: pageData.frontmatter.tag }
])
}
if (pageData.frontmatter.date) {
head.push([
'meta',
@ -102,6 +108,7 @@ export function generateMeta(context: TransformContext, hostname: string) {
}
])
}
if (pageData.lastUpdated && pageData.frontmatter.lastUpdated !== false) {
head.push([
'meta',