@fy-/fws-vue 2.0.21 → 2.0.22
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 +39 -29
- package/package.json +1 -1
package/composables/seo.ts
CHANGED
|
@@ -113,56 +113,66 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
|
|
|
113
113
|
articlePublishedTime: () => seoData.value.published,
|
|
114
114
|
articleModifiedTime: () => seoData.value.modified,
|
|
115
115
|
ogImageSecureUrl: () => {
|
|
116
|
-
if (seoData.value.image
|
|
117
|
-
if (seoData.value.
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
116
|
+
if (seoData.value.image) {
|
|
117
|
+
if (seoData.value.image.includes("?vars=")) {
|
|
118
|
+
if (seoData.value.imageType) {
|
|
119
|
+
return seoData.value.image.replace(
|
|
120
|
+
"?vars=",
|
|
121
|
+
`.${seoData.value.imageType}?vars=`,
|
|
122
|
+
);
|
|
123
|
+
} else {
|
|
124
|
+
return seoData.value.image.replace("?vars=", ".png?vars=");
|
|
125
|
+
}
|
|
124
126
|
}
|
|
127
|
+
return seoData.value.image;
|
|
125
128
|
}
|
|
126
|
-
return seoData.value.image;
|
|
127
129
|
},
|
|
128
130
|
ogImageUrl: () => {
|
|
129
|
-
if (seoData.value.image
|
|
130
|
-
if (seoData.value.
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
131
|
+
if (seoData.value.image) {
|
|
132
|
+
if (seoData.value.image.includes("?vars=")) {
|
|
133
|
+
if (seoData.value.imageType) {
|
|
134
|
+
return seoData.value.image.replace(
|
|
135
|
+
"?vars=",
|
|
136
|
+
`.${seoData.value.imageType}?vars=`,
|
|
137
|
+
);
|
|
138
|
+
} else {
|
|
139
|
+
return seoData.value.image.replace("?vars=", ".png?vars=");
|
|
140
|
+
}
|
|
137
141
|
}
|
|
142
|
+
return seoData.value.image;
|
|
138
143
|
}
|
|
139
|
-
return seoData.value.image;
|
|
140
144
|
},
|
|
141
145
|
ogImageType: () => {
|
|
142
146
|
if (seoData.value.imageType) {
|
|
143
147
|
return seoData.value.imageType
|
|
144
|
-
?
|
|
148
|
+
? seoData.value.imageType.includes("image/")
|
|
149
|
+
? seoData.value.imageType
|
|
150
|
+
: `image/${seoData.value.imageType}`
|
|
145
151
|
: "image/png";
|
|
146
152
|
}
|
|
147
153
|
return undefined;
|
|
148
154
|
},
|
|
149
155
|
twitterImageUrl: () => {
|
|
150
|
-
if (seoData.value.image
|
|
151
|
-
if (seoData.value.
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
if (seoData.value.image) {
|
|
157
|
+
if (seoData.value.image.includes("?vars=")) {
|
|
158
|
+
if (seoData.value.imageType) {
|
|
159
|
+
return seoData.value.image.replace(
|
|
160
|
+
"?vars=",
|
|
161
|
+
`.${seoData.value.imageType}?vars=`,
|
|
162
|
+
);
|
|
163
|
+
} else {
|
|
164
|
+
return seoData.value.image.replace("?vars=", ".png?vars=");
|
|
165
|
+
}
|
|
158
166
|
}
|
|
167
|
+
return seoData.value.image;
|
|
159
168
|
}
|
|
160
|
-
return seoData.value.image;
|
|
161
169
|
},
|
|
162
170
|
twitterImageType() {
|
|
163
171
|
if (seoData.value.imageType) {
|
|
164
172
|
return seoData.value.imageType
|
|
165
|
-
?
|
|
173
|
+
? seoData.value.imageType.includes("image/")
|
|
174
|
+
? seoData.value.imageType
|
|
175
|
+
: `image/${seoData.value.imageType}`
|
|
166
176
|
: "image/png";
|
|
167
177
|
}
|
|
168
178
|
return undefined;
|