@fy-/fws-vue 2.0.4 → 2.0.6
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 +15 -42
- package/package.json +1 -1
package/composables/seo.ts
CHANGED
|
@@ -43,45 +43,6 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
|
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
/*
|
|
47
|
-
if (seoData.value.imageHeight && seoData.value.image) {
|
|
48
|
-
metas.push({
|
|
49
|
-
property: "og:image:height",
|
|
50
|
-
content: seoData.value.imageHeight,
|
|
51
|
-
key: "og:image:height",
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
if (seoData.value.imageWidth && seoData.value.image) {
|
|
55
|
-
metas.push({
|
|
56
|
-
property: "og:image:width",
|
|
57
|
-
content: seoData.value.imageWidth,
|
|
58
|
-
key: "og:image:width",
|
|
59
|
-
});
|
|
60
|
-
}*/
|
|
61
|
-
if (seoData.value.imageType && seoData.value.image) {
|
|
62
|
-
metas.push({
|
|
63
|
-
property: "og:image:type",
|
|
64
|
-
content: seoData.value.imageType,
|
|
65
|
-
key: "og:image:type",
|
|
66
|
-
});
|
|
67
|
-
metas.push({
|
|
68
|
-
name: "twitter:image:type",
|
|
69
|
-
content: seoData.value.imageType,
|
|
70
|
-
key: "twitter:image:type",
|
|
71
|
-
});
|
|
72
|
-
} else if (seoData.value.image) {
|
|
73
|
-
metas.push({
|
|
74
|
-
property: "og:image:type",
|
|
75
|
-
content: "image/png",
|
|
76
|
-
key: "og:image:type",
|
|
77
|
-
});
|
|
78
|
-
metas.push({
|
|
79
|
-
name: "twitter:image:type",
|
|
80
|
-
content: "image/png",
|
|
81
|
-
key: "twitter:image:type",
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
|
|
85
46
|
return metas;
|
|
86
47
|
},
|
|
87
48
|
link: () => {
|
|
@@ -120,19 +81,17 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
|
|
|
120
81
|
});
|
|
121
82
|
|
|
122
83
|
useSeoMeta({
|
|
123
|
-
ogUrl: `${getURL().Scheme}://${getURL().Host}${route.fullPath}`,
|
|
84
|
+
ogUrl: () => `${getURL().Scheme}://${getURL().Host}${route.fullPath}`,
|
|
124
85
|
ogLocale: () => currentLocale,
|
|
125
86
|
robots:
|
|
126
87
|
"index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1",
|
|
127
88
|
title: () => seoData.value.title,
|
|
128
89
|
ogTitle: () => seoData.value.title,
|
|
129
90
|
ogDescription: () => seoData.value.description,
|
|
130
|
-
ogImage: () => seoData.value.image,
|
|
131
91
|
twitterCard: "summary_large_image",
|
|
132
92
|
ogSiteName: () => seoData.value.name,
|
|
133
93
|
twitterTitle: () => seoData.value.title,
|
|
134
94
|
twitterDescription: () => seoData.value.description,
|
|
135
|
-
twitterImage: () => seoData.value.image,
|
|
136
95
|
ogImageAlt: () => {
|
|
137
96
|
if (seoData.value.image) {
|
|
138
97
|
return seoData.value.title;
|
|
@@ -152,5 +111,19 @@ 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 ? seoData.value.imageType : "image/png";
|
|
119
|
+
}
|
|
120
|
+
return undefined;
|
|
121
|
+
},
|
|
122
|
+
twitterImageType() {
|
|
123
|
+
if (seoData.value.imageType) {
|
|
124
|
+
return seoData.value.imageType ? seoData.value.imageType : "image/png";
|
|
125
|
+
}
|
|
126
|
+
return undefined;
|
|
127
|
+
},
|
|
155
128
|
});
|
|
156
129
|
};
|