@fy-/fws-vue 2.0.11 → 2.0.13
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 +16 -4
- package/package.json +1 -1
package/composables/seo.ts
CHANGED
|
@@ -32,6 +32,18 @@ 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
|
+
const actualImage = seoData.value.image;
|
|
36
|
+
if (seoData.value.image && seoData.value.image.includes("?vars=")) {
|
|
37
|
+
if (seoData.value.imageType) {
|
|
38
|
+
actualImage = seoData.value.image.replace(
|
|
39
|
+
"?vars=",
|
|
40
|
+
`.${seoData.value.imageType}?vars=`,
|
|
41
|
+
);
|
|
42
|
+
} else {
|
|
43
|
+
actualImage = seoData.value.image.replace("?vars=", ".png?vars=");
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
35
47
|
useHead({
|
|
36
48
|
meta: () => {
|
|
37
49
|
const metas: any[] = [];
|
|
@@ -93,7 +105,7 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
|
|
|
93
105
|
twitterTitle: () => seoData.value.title,
|
|
94
106
|
twitterDescription: () => seoData.value.description,
|
|
95
107
|
ogImageAlt: () => {
|
|
96
|
-
if (
|
|
108
|
+
if (actualImage) {
|
|
97
109
|
return seoData.value.title;
|
|
98
110
|
}
|
|
99
111
|
return undefined;
|
|
@@ -102,7 +114,7 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
|
|
|
102
114
|
twitterCreator: () => seoData.value.twitterCreator,
|
|
103
115
|
twitterSite: () => seoData.value.twitterCreator,
|
|
104
116
|
twitterImageAlt: () => {
|
|
105
|
-
if (
|
|
117
|
+
if (actualImage) {
|
|
106
118
|
return seoData.value.title;
|
|
107
119
|
}
|
|
108
120
|
return undefined;
|
|
@@ -111,8 +123,8 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
|
|
|
111
123
|
keywords: () => seoData.value.keywords,
|
|
112
124
|
articlePublishedTime: () => seoData.value.published,
|
|
113
125
|
articleModifiedTime: () => seoData.value.modified,
|
|
114
|
-
ogImageSecureUrl: () =>
|
|
115
|
-
ogImageUrl: () =>
|
|
126
|
+
ogImageSecureUrl: () => actualImage,
|
|
127
|
+
ogImageUrl: () => actualImage,
|
|
116
128
|
ogImageType: () => {
|
|
117
129
|
if (seoData.value.imageType) {
|
|
118
130
|
return seoData.value.imageType
|