修改了首页

This commit is contained in:
2026-03-05 13:32:48 +08:00
commit 2c80df8b07
322 changed files with 48063 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
import { useHead, useRequestURL, useSeoMeta } from '#app'
type SeoInput = {
title: string
description: string
path?: string
}
function getSiteOrigin() {
if (import.meta.client) return window.location.origin
try {
return useRequestURL().origin
} catch {
return ''
}
}
export function usePageSeo(input: SeoInput) {
const origin = getSiteOrigin()
const url = input.path && origin ? new URL(input.path, origin).toString() : undefined
useSeoMeta({
title: input.title,
description: input.description,
ogTitle: input.title,
ogDescription: input.description,
ogType: 'website',
...(url ? { ogUrl: url } : {}),
twitterCard: 'summary_large_image'
})
if (url) {
useHead({
link: [{ rel: 'canonical', href: url }]
})
}
}