@fy-/fws-vue 2.0.1 → 2.0.4
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 +24 -12
- package/package.json +1 -1
package/composables/seo.ts
CHANGED
|
@@ -25,6 +25,7 @@ export interface LazyHead {
|
|
|
25
25
|
canonical?: string;
|
|
26
26
|
isAdult?: boolean;
|
|
27
27
|
alternateLocales?: string[];
|
|
28
|
+
twitterCreator?: string;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
|
|
@@ -42,17 +43,13 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
|
|
|
42
43
|
});
|
|
43
44
|
}
|
|
44
45
|
|
|
46
|
+
/*
|
|
45
47
|
if (seoData.value.imageHeight && seoData.value.image) {
|
|
46
48
|
metas.push({
|
|
47
49
|
property: "og:image:height",
|
|
48
50
|
content: seoData.value.imageHeight,
|
|
49
51
|
key: "og:image:height",
|
|
50
52
|
});
|
|
51
|
-
metas.push({
|
|
52
|
-
name: "twitter:image:height",
|
|
53
|
-
content: seoData.value.imageHeight,
|
|
54
|
-
key: "twitter:image:height",
|
|
55
|
-
});
|
|
56
53
|
}
|
|
57
54
|
if (seoData.value.imageWidth && seoData.value.image) {
|
|
58
55
|
metas.push({
|
|
@@ -60,12 +57,7 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
|
|
|
60
57
|
content: seoData.value.imageWidth,
|
|
61
58
|
key: "og:image:width",
|
|
62
59
|
});
|
|
63
|
-
|
|
64
|
-
name: "twitter:image:width",
|
|
65
|
-
content: seoData.value.imageWidth,
|
|
66
|
-
key: "twitter:image:width",
|
|
67
|
-
});
|
|
68
|
-
}
|
|
60
|
+
}*/
|
|
69
61
|
if (seoData.value.imageType && seoData.value.image) {
|
|
70
62
|
metas.push({
|
|
71
63
|
property: "og:image:type",
|
|
@@ -114,12 +106,22 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
|
|
|
114
106
|
}
|
|
115
107
|
});
|
|
116
108
|
|
|
109
|
+
if (seoData.value.image) {
|
|
110
|
+
links.push({
|
|
111
|
+
rel: "preload",
|
|
112
|
+
href: seoData.value.image,
|
|
113
|
+
as: "image",
|
|
114
|
+
fetchpriority: "high",
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
117
118
|
return links;
|
|
118
119
|
},
|
|
119
120
|
});
|
|
120
121
|
|
|
121
122
|
useSeoMeta({
|
|
122
|
-
|
|
123
|
+
ogUrl: `${getURL().Scheme}://${getURL().Host}${route.fullPath}`,
|
|
124
|
+
ogLocale: () => currentLocale,
|
|
123
125
|
robots:
|
|
124
126
|
"index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1",
|
|
125
127
|
title: () => seoData.value.title,
|
|
@@ -127,9 +129,19 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
|
|
|
127
129
|
ogDescription: () => seoData.value.description,
|
|
128
130
|
ogImage: () => seoData.value.image,
|
|
129
131
|
twitterCard: "summary_large_image",
|
|
132
|
+
ogSiteName: () => seoData.value.name,
|
|
130
133
|
twitterTitle: () => seoData.value.title,
|
|
131
134
|
twitterDescription: () => seoData.value.description,
|
|
132
135
|
twitterImage: () => seoData.value.image,
|
|
136
|
+
ogImageAlt: () => {
|
|
137
|
+
if (seoData.value.image) {
|
|
138
|
+
return seoData.value.title;
|
|
139
|
+
}
|
|
140
|
+
return undefined;
|
|
141
|
+
},
|
|
142
|
+
ogType: () => (seoData.value.type ? seoData.value.type : "website"),
|
|
143
|
+
twitterCreator: () => seoData.value.twitterCreator,
|
|
144
|
+
twitterSite: () => seoData.value.twitterCreator,
|
|
133
145
|
twitterImageAlt: () => {
|
|
134
146
|
if (seoData.value.image) {
|
|
135
147
|
return seoData.value.title;
|