@fy-/fws-vue 2.0.18 → 2.0.20
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 +30 -15
- package/package.json +1 -1
package/composables/seo.ts
CHANGED
|
@@ -32,17 +32,6 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
|
|
|
32
32
|
const route = useRoute();
|
|
33
33
|
const currentLocale = getLocale();
|
|
34
34
|
const url = getURL();
|
|
35
|
-
let actualImage = seoData.value.image?.toString();
|
|
36
|
-
if (actualImage && seoData.value.image.includes("?vars=")) {
|
|
37
|
-
if (seoData.value.imageType) {
|
|
38
|
-
actualImage = actualImage.replace(
|
|
39
|
-
"?vars=",
|
|
40
|
-
`.${seoData.value.imageType}?vars=`,
|
|
41
|
-
);
|
|
42
|
-
} else {
|
|
43
|
-
actualImage = actualImage.replace("?vars=", ".png?vars=");
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
35
|
|
|
47
36
|
useHead({
|
|
48
37
|
meta: () => {
|
|
@@ -105,7 +94,7 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
|
|
|
105
94
|
twitterTitle: () => seoData.value.title,
|
|
106
95
|
twitterDescription: () => seoData.value.description,
|
|
107
96
|
ogImageAlt: () => {
|
|
108
|
-
if (
|
|
97
|
+
if (seoData.value.image) {
|
|
109
98
|
return seoData.value.title;
|
|
110
99
|
}
|
|
111
100
|
return undefined;
|
|
@@ -114,7 +103,7 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
|
|
|
114
103
|
twitterCreator: () => seoData.value.twitterCreator,
|
|
115
104
|
twitterSite: () => seoData.value.twitterCreator,
|
|
116
105
|
twitterImageAlt: () => {
|
|
117
|
-
if (
|
|
106
|
+
if (seoData.value.image) {
|
|
118
107
|
return seoData.value.title;
|
|
119
108
|
}
|
|
120
109
|
return undefined;
|
|
@@ -123,8 +112,34 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
|
|
|
123
112
|
keywords: () => seoData.value.keywords,
|
|
124
113
|
articlePublishedTime: () => seoData.value.published,
|
|
125
114
|
articleModifiedTime: () => seoData.value.modified,
|
|
126
|
-
ogImageSecureUrl: () =>
|
|
127
|
-
|
|
115
|
+
ogImageSecureUrl: () => {
|
|
116
|
+
if (seoData.value.image && seoData.value.image.includes("?vars=")) {
|
|
117
|
+
if (seoData.value.imageType) {
|
|
118
|
+
return seoData.value.image.replace(
|
|
119
|
+
"?vars=",
|
|
120
|
+
`.${seoData.value.imageType}?vars=`,
|
|
121
|
+
);
|
|
122
|
+
} else {
|
|
123
|
+
return seoData.value.image.replace("?vars=", ".png?vars=");
|
|
124
|
+
}
|
|
125
|
+
} else if (seoData.value.image) {
|
|
126
|
+
return seoData.value.image;
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
ogImageUrl: () => {
|
|
130
|
+
if (seoData.value.image && seoData.value.image.includes("?vars=")) {
|
|
131
|
+
if (seoData.value.imageType) {
|
|
132
|
+
return seoData.value.image.replace(
|
|
133
|
+
"?vars=",
|
|
134
|
+
`.${seoData.value.imageType}?vars=`,
|
|
135
|
+
);
|
|
136
|
+
} else {
|
|
137
|
+
return seoData.value.image.replace("?vars=", ".png?vars=");
|
|
138
|
+
}
|
|
139
|
+
} else if (seoData.value.image) {
|
|
140
|
+
return seoData.value.image;
|
|
141
|
+
}
|
|
142
|
+
},
|
|
128
143
|
ogImageType: () => {
|
|
129
144
|
if (seoData.value.imageType) {
|
|
130
145
|
return seoData.value.imageType
|