feat: 更新 useSeo 以添加网站图标和社交媒体元数据,删除旧的 favicon 文件

This commit is contained in:
keven
2025-06-22 13:42:19 +08:00
parent 88b8daa5df
commit 2f5388d0a8
2 changed files with 17 additions and 2 deletions

View File

@@ -14,6 +14,15 @@ const useSeo = async (props: UseSeoProps = {}) => {
}
const { title } = head || {}
useHead({
link: [
{ rel: 'icon', href: '/logo.png', sizes: 'any' },
// { rel: 'icon', href: '/favicon.svg', sizes: 'any', type: 'image/svg+xml' },
{ rel: 'apple-touch-icon', sizes: '180x180', href: '/logo.png' },
],
meta: [
// used on some mobile browsers
{ name: 'theme-color', content: '#395276' },
],
...head,
title: title ? `${title} - ${seoMeta?.value?.site_title}` : seoMeta?.value?.site_title,
})
@@ -23,8 +32,14 @@ const useSeo = async (props: UseSeoProps = {}) => {
description: seoMeta?.value?.site_desc,
ogTitle: seoMeta?.value?.site_title,
ogDescription: seoMeta?.value?.site_desc,
// ogImage: seoMeta?.value?.site_url,
// twitterCard: 'summary_large_image',
ogImage: {
url: `${seoMeta?.value?.site_url}/logo.png`,
width: 1024,
height: 1024,
alt: 'logo',
type: 'image/png',
},
twitterCard: 'summary',
})
}
return

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB