@fy-/fws-vue 2.0.1 → 2.0.3
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 +20 -10
- 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) => {
|
|
@@ -48,11 +49,6 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
|
|
|
48
49
|
content: seoData.value.imageHeight,
|
|
49
50
|
key: "og:image:height",
|
|
50
51
|
});
|
|
51
|
-
metas.push({
|
|
52
|
-
name: "twitter:image:height",
|
|
53
|
-
content: seoData.value.imageHeight,
|
|
54
|
-
key: "twitter:image:height",
|
|
55
|
-
});
|
|
56
52
|
}
|
|
57
53
|
if (seoData.value.imageWidth && seoData.value.image) {
|
|
58
54
|
metas.push({
|
|
@@ -60,11 +56,6 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
|
|
|
60
56
|
content: seoData.value.imageWidth,
|
|
61
57
|
key: "og:image:width",
|
|
62
58
|
});
|
|
63
|
-
metas.push({
|
|
64
|
-
name: "twitter:image:width",
|
|
65
|
-
content: seoData.value.imageWidth,
|
|
66
|
-
key: "twitter:image:width",
|
|
67
|
-
});
|
|
68
59
|
}
|
|
69
60
|
if (seoData.value.imageType && seoData.value.image) {
|
|
70
61
|
metas.push({
|
|
@@ -114,6 +105,15 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
|
|
|
114
105
|
}
|
|
115
106
|
});
|
|
116
107
|
|
|
108
|
+
if (seoData.value.image) {
|
|
109
|
+
links.push({
|
|
110
|
+
rel: "preload",
|
|
111
|
+
href: seoData.value.image,
|
|
112
|
+
as: "image",
|
|
113
|
+
fetchpriority: "high",
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
|
|
117
117
|
return links;
|
|
118
118
|
},
|
|
119
119
|
});
|
|
@@ -127,9 +127,19 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
|
|
|
127
127
|
ogDescription: () => seoData.value.description,
|
|
128
128
|
ogImage: () => seoData.value.image,
|
|
129
129
|
twitterCard: "summary_large_image",
|
|
130
|
+
ogSiteName: () => seoData.value.name,
|
|
130
131
|
twitterTitle: () => seoData.value.title,
|
|
131
132
|
twitterDescription: () => seoData.value.description,
|
|
132
133
|
twitterImage: () => seoData.value.image,
|
|
134
|
+
ogImageAlt: () => {
|
|
135
|
+
if (seoData.value.image) {
|
|
136
|
+
return seoData.value.title;
|
|
137
|
+
}
|
|
138
|
+
return undefined;
|
|
139
|
+
},
|
|
140
|
+
ogType: () => (seoData.value.type ? seoData.value.type : "website"),
|
|
141
|
+
twitterCreator: () => seoData.value.twitterCreator,
|
|
142
|
+
twitterSite: () => seoData.value.twitterCreator,
|
|
133
143
|
twitterImageAlt: () => {
|
|
134
144
|
if (seoData.value.image) {
|
|
135
145
|
return seoData.value.title;
|