@fy-/fws-vue 2.0.5 → 2.0.7
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 +19 -42
- package/package.json +1 -1
package/composables/seo.ts
CHANGED
|
@@ -43,47 +43,6 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
|
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
if (seoData.value.image) {
|
|
47
|
-
metas.push({
|
|
48
|
-
property: "og:image",
|
|
49
|
-
content: seoData.value.image,
|
|
50
|
-
key: "og:image",
|
|
51
|
-
});
|
|
52
|
-
metas.push({
|
|
53
|
-
name: "twitter:image",
|
|
54
|
-
content: seoData.value.image,
|
|
55
|
-
key: "twitter:image",
|
|
56
|
-
});
|
|
57
|
-
metas.push({
|
|
58
|
-
name: "image",
|
|
59
|
-
content: seoData.value.image,
|
|
60
|
-
key: "image",
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
if (seoData.value.imageType && seoData.value.image) {
|
|
64
|
-
metas.push({
|
|
65
|
-
property: "og:image:type",
|
|
66
|
-
content: seoData.value.imageType,
|
|
67
|
-
key: "og:image:type",
|
|
68
|
-
});
|
|
69
|
-
metas.push({
|
|
70
|
-
name: "twitter:image:type",
|
|
71
|
-
content: seoData.value.imageType,
|
|
72
|
-
key: "twitter:image:type",
|
|
73
|
-
});
|
|
74
|
-
} else if (seoData.value.image) {
|
|
75
|
-
metas.push({
|
|
76
|
-
property: "og:image:type",
|
|
77
|
-
content: "image/png",
|
|
78
|
-
key: "og:image:type",
|
|
79
|
-
});
|
|
80
|
-
metas.push({
|
|
81
|
-
name: "twitter:image:type",
|
|
82
|
-
content: "image/png",
|
|
83
|
-
key: "twitter:image:type",
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
|
|
87
46
|
return metas;
|
|
88
47
|
},
|
|
89
48
|
link: () => {
|
|
@@ -122,7 +81,7 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
|
|
|
122
81
|
});
|
|
123
82
|
|
|
124
83
|
useSeoMeta({
|
|
125
|
-
ogUrl: `${getURL().Scheme}://${getURL().Host}${route.fullPath}`,
|
|
84
|
+
ogUrl: () => `${getURL().Scheme}://${getURL().Host}${route.fullPath}`,
|
|
126
85
|
ogLocale: () => currentLocale,
|
|
127
86
|
robots:
|
|
128
87
|
"index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1",
|
|
@@ -152,5 +111,23 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
|
|
|
152
111
|
keywords: () => seoData.value.keywords,
|
|
153
112
|
articlePublishedTime: () => seoData.value.published,
|
|
154
113
|
articleModifiedTime: () => seoData.value.modified,
|
|
114
|
+
ogImage: () => seoData.value.image,
|
|
115
|
+
ogImageSecureUrl: () => seoData.value.image,
|
|
116
|
+
ogImageType: () => {
|
|
117
|
+
if (seoData.value.imageType) {
|
|
118
|
+
return seoData.value.imageType
|
|
119
|
+
? "image/" + seoData.value.imageType
|
|
120
|
+
: "image/png";
|
|
121
|
+
}
|
|
122
|
+
return undefined;
|
|
123
|
+
},
|
|
124
|
+
twitterImageType() {
|
|
125
|
+
if (seoData.value.imageType) {
|
|
126
|
+
return seoData.value.imageType
|
|
127
|
+
? "image/" + seoData.value.imageType
|
|
128
|
+
: "image/png";
|
|
129
|
+
}
|
|
130
|
+
return undefined;
|
|
131
|
+
},
|
|
155
132
|
});
|
|
156
133
|
};
|