@fy-/fws-vue 2.0.18 → 2.0.19

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.
Files changed (2) hide show
  1. package/composables/seo.ts +28 -13
  2. package/package.json +1 -1
@@ -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: () => {
@@ -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: () => actualImage,
127
- ogImageUrl: () => actualImage,
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fy-/fws-vue",
3
- "version": "2.0.18",
3
+ "version": "2.0.19",
4
4
  "author": "Florian 'Fy' Gasquez <m@fy.to>",
5
5
  "license": "MIT",
6
6
  "repository": {