@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.
Files changed (2) hide show
  1. package/composables/seo.ts +16 -4
  2. package/package.json +1 -1
@@ -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 (seoData.value.image) {
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 (seoData.value.image) {
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: () => seoData.value.image,
115
- ogImageUrl: () => seoData.value.image,
126
+ ogImageSecureUrl: () => actualImage,
127
+ ogImageUrl: () => actualImage,
116
128
  ogImageType: () => {
117
129
  if (seoData.value.imageType) {
118
130
  return seoData.value.imageType
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fy-/fws-vue",
3
- "version": "2.0.11",
3
+ "version": "2.0.13",
4
4
  "author": "Florian 'Fy' Gasquez <m@fy.to>",
5
5
  "license": "MIT",
6
6
  "repository": {