@fy-/fws-vue 2.0.20 → 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 +41 -20
- package/package.json +1 -1
package/composables/seo.ts
CHANGED
|
@@ -113,45 +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
|
}
|
|
125
|
-
} else if (seoData.value.image) {
|
|
126
127
|
return seoData.value.image;
|
|
127
128
|
}
|
|
128
129
|
},
|
|
129
130
|
ogImageUrl: () => {
|
|
130
|
-
if (seoData.value.image
|
|
131
|
-
if (seoData.value.
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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
|
+
}
|
|
138
141
|
}
|
|
139
|
-
} else if (seoData.value.image) {
|
|
140
142
|
return seoData.value.image;
|
|
141
143
|
}
|
|
142
144
|
},
|
|
143
145
|
ogImageType: () => {
|
|
144
146
|
if (seoData.value.imageType) {
|
|
145
147
|
return seoData.value.imageType
|
|
146
|
-
?
|
|
148
|
+
? seoData.value.imageType.includes("image/")
|
|
149
|
+
? seoData.value.imageType
|
|
150
|
+
: `image/${seoData.value.imageType}`
|
|
147
151
|
: "image/png";
|
|
148
152
|
}
|
|
149
153
|
return undefined;
|
|
150
154
|
},
|
|
155
|
+
twitterImageUrl: () => {
|
|
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
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return seoData.value.image;
|
|
168
|
+
}
|
|
169
|
+
},
|
|
151
170
|
twitterImageType() {
|
|
152
171
|
if (seoData.value.imageType) {
|
|
153
172
|
return seoData.value.imageType
|
|
154
|
-
?
|
|
173
|
+
? seoData.value.imageType.includes("image/")
|
|
174
|
+
? seoData.value.imageType
|
|
175
|
+
: `image/${seoData.value.imageType}`
|
|
155
176
|
: "image/png";
|
|
156
177
|
}
|
|
157
178
|
return undefined;
|