@fy-/fws-vue 2.3.32 → 2.3.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/composables/seo.ts +6 -3
- package/package.json +1 -1
package/composables/seo.ts
CHANGED
|
@@ -46,8 +46,8 @@ function processImageUrl(image: string | undefined, imageType: string | undefine
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
// Helper function to normalize image type
|
|
49
|
-
function normalizeImageType(imageType: string | undefined): 'image/jpeg' | 'image/gif' | 'image/png' |
|
|
50
|
-
if (!imageType) return
|
|
49
|
+
function normalizeImageType(imageType: string | undefined): 'image/jpeg' | 'image/gif' | 'image/png' | null {
|
|
50
|
+
if (!imageType) return null
|
|
51
51
|
|
|
52
52
|
const type = imageType.includes('image/') ? imageType : `image/${imageType}`
|
|
53
53
|
if (type === 'image/jpeg' || type === 'image/gif' || type === 'image/png') {
|
|
@@ -72,7 +72,10 @@ export function useSeo(seoData: Ref<LazyHead>, initial: boolean = false) {
|
|
|
72
72
|
// Memoize common values
|
|
73
73
|
const localeForOg = computed(() => currentLocale?.replace('-', '_'))
|
|
74
74
|
const imageUrl = computed(() => processImageUrl(seoData.value.image, seoData.value.imageType))
|
|
75
|
-
const imageType = computed(() =>
|
|
75
|
+
const imageType = computed(() => {
|
|
76
|
+
const type = normalizeImageType(seoData.value.imageType)
|
|
77
|
+
return type === null ? undefined : type
|
|
78
|
+
})
|
|
76
79
|
const imageAlt = computed(() => seoData.value.image ? seoData.value.title : undefined)
|
|
77
80
|
|
|
78
81
|
useHead({
|