1
0

nuxt初始化

This commit is contained in:
2026-04-20 09:45:20 +08:00
parent e90903a378
commit d3eb1d3424
508 changed files with 35562 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
type SeoInput = {
title: string
description?: string
keywords?: string
ogImage?: string
canonicalPath?: string
}
export function useSeo(input: SeoInput) {
const siteUrl = 'https://example.com'
const fullTitle = `${input.title} - 烟台岸基网络科技有限公司`
const canonical = input.canonicalPath ? `${siteUrl}${input.canonicalPath}` : undefined
useSeoMeta({
title: fullTitle,
description: input.description,
keywords: input.keywords,
ogTitle: fullTitle,
ogDescription: input.description,
ogImage: input.ogImage,
twitterCard: input.ogImage ? 'summary_large_image' : 'summary'
})
if (canonical) {
useHead({
link: [
{
rel: 'canonical',
href: canonical
}
]
})
}
}