@fy-/fws-vue 2.0.13 → 2.0.15
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 +9 -9
- package/package.json +1 -1
package/composables/seo.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import type { Ref } from "vue";
|
|
2
|
+
import type { Ref, ref } from "vue";
|
|
3
3
|
import { useHead, useSeoMeta } from "@unhead/vue";
|
|
4
4
|
import { getURL, getLocale, getPrefix } from "@fy-/fws-js";
|
|
5
5
|
import { useRoute } from "vue-router";
|
|
@@ -32,15 +32,15 @@ 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 (
|
|
35
|
+
const actualImage = ref(seoData.value.image);
|
|
36
|
+
if (actualImage.value && seoData.value.image.includes("?vars=")) {
|
|
37
37
|
if (seoData.value.imageType) {
|
|
38
|
-
actualImage =
|
|
38
|
+
actualImage.value = actualImage.value.replace(
|
|
39
39
|
"?vars=",
|
|
40
40
|
`.${seoData.value.imageType}?vars=`,
|
|
41
41
|
);
|
|
42
42
|
} else {
|
|
43
|
-
actualImage =
|
|
43
|
+
actualImage.value = actualImage.value.replace("?vars=", ".png?vars=");
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -105,7 +105,7 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
|
|
|
105
105
|
twitterTitle: () => seoData.value.title,
|
|
106
106
|
twitterDescription: () => seoData.value.description,
|
|
107
107
|
ogImageAlt: () => {
|
|
108
|
-
if (actualImage) {
|
|
108
|
+
if (actualImage.value) {
|
|
109
109
|
return seoData.value.title;
|
|
110
110
|
}
|
|
111
111
|
return undefined;
|
|
@@ -114,7 +114,7 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
|
|
|
114
114
|
twitterCreator: () => seoData.value.twitterCreator,
|
|
115
115
|
twitterSite: () => seoData.value.twitterCreator,
|
|
116
116
|
twitterImageAlt: () => {
|
|
117
|
-
if (actualImage) {
|
|
117
|
+
if (actualImage.value) {
|
|
118
118
|
return seoData.value.title;
|
|
119
119
|
}
|
|
120
120
|
return undefined;
|
|
@@ -123,8 +123,8 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
|
|
|
123
123
|
keywords: () => seoData.value.keywords,
|
|
124
124
|
articlePublishedTime: () => seoData.value.published,
|
|
125
125
|
articleModifiedTime: () => seoData.value.modified,
|
|
126
|
-
ogImageSecureUrl: () => actualImage,
|
|
127
|
-
ogImageUrl: () => actualImage,
|
|
126
|
+
ogImageSecureUrl: () => actualImage.value,
|
|
127
|
+
ogImageUrl: () => actualImage.value,
|
|
128
128
|
ogImageType: () => {
|
|
129
129
|
if (seoData.value.imageType) {
|
|
130
130
|
return seoData.value.imageType
|