官网开发 0804
This commit is contained in:
+13
-1
@@ -22,10 +22,22 @@ const head = useLocaleHead({
|
||||
seo: true
|
||||
});
|
||||
|
||||
// Favicon(来自 dashboard 站点信息,站点数据异步加载完成后动态注入;/uploads/... 相对路径已由数据层解析)
|
||||
const faviconHref = computed(() => siteStore.site?.favicon_url || '');
|
||||
const faviconType = computed(() => {
|
||||
if (faviconHref.value.endsWith('.svg')) return 'image/svg+xml';
|
||||
if (faviconHref.value.endsWith('.png')) return 'image/png';
|
||||
if (faviconHref.value.endsWith('.ico')) return 'image/x-icon';
|
||||
return '';
|
||||
});
|
||||
|
||||
useHead({
|
||||
title: () => (locale.value === 'zh' ? zhCN.app.name : enUS.app.name),
|
||||
htmlAttrs: head.value.htmlAttrs,
|
||||
link: [...(head.value.link || [])],
|
||||
link: () => [
|
||||
...(head.value.link || []),
|
||||
...(faviconHref.value ? [{ rel: 'icon' as const, type: faviconType.value || undefined, href: faviconHref.value }] : [])
|
||||
],
|
||||
meta: [...(head.value.meta || [])]
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user