@fy-/fws-vue 2.0.21 → 2.0.23

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 +42 -32
  2. package/package.json +1 -1
@@ -30,7 +30,7 @@ export interface LazyHead {
30
30
 
31
31
  export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
32
32
  const route = useRoute();
33
- const currentLocale = getLocale();
33
+ const d = getLocale();
34
34
  const url = getURL();
35
35
 
36
36
  useHead({
@@ -56,7 +56,7 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
56
56
  });
57
57
 
58
58
  seoData.value.alternateLocales?.forEach((locale) => {
59
- if (locale !== currentLocale) {
59
+ if (locale !== d) {
60
60
  links.push({
61
61
  rel: "alternate",
62
62
  hreflang: locale,
@@ -83,7 +83,7 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
83
83
 
84
84
  useSeoMeta({
85
85
  ogUrl: () => `${getURL().Scheme}://${getURL().Host}${route.fullPath}`,
86
- ogLocale: () => currentLocale,
86
+ ogLocale: () => currentLocale.replace("-", "_"),
87
87
  robots:
88
88
  "index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1",
89
89
  title: () => seoData.value.title,
@@ -113,56 +113,66 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
113
113
  articlePublishedTime: () => seoData.value.published,
114
114
  articleModifiedTime: () => seoData.value.modified,
115
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=");
116
+ if (seoData.value.image) {
117
+ if (seoData.value.image.includes("?vars=")) {
118
+ if (seoData.value.imageType) {
119
+ return seoData.value.image.replace(
120
+ "?vars=",
121
+ `.${seoData.value.imageType}?vars=`,
122
+ );
123
+ } else {
124
+ return seoData.value.image.replace("?vars=", ".png?vars=");
125
+ }
124
126
  }
127
+ return seoData.value.image;
125
128
  }
126
- return seoData.value.image;
127
129
  },
128
130
  ogImageUrl: () => {
129
- if (seoData.value.image && seoData.value.image.includes("?vars=")) {
130
- if (seoData.value.imageType) {
131
- return seoData.value.image.replace(
132
- "?vars=",
133
- `.${seoData.value.imageType}?vars=`,
134
- );
135
- } else {
136
- return seoData.value.image.replace("?vars=", ".png?vars=");
131
+ if (seoData.value.image) {
132
+ if (seoData.value.image.includes("?vars=")) {
133
+ if (seoData.value.imageType) {
134
+ return seoData.value.image.replace(
135
+ "?vars=",
136
+ `.${seoData.value.imageType}?vars=`,
137
+ );
138
+ } else {
139
+ return seoData.value.image.replace("?vars=", ".png?vars=");
140
+ }
137
141
  }
142
+ return seoData.value.image;
138
143
  }
139
- return seoData.value.image;
140
144
  },
141
145
  ogImageType: () => {
142
146
  if (seoData.value.imageType) {
143
147
  return seoData.value.imageType
144
- ? "image/" + seoData.value.imageType
148
+ ? seoData.value.imageType.includes("image/")
149
+ ? seoData.value.imageType
150
+ : `image/${seoData.value.imageType}`
145
151
  : "image/png";
146
152
  }
147
153
  return undefined;
148
154
  },
149
155
  twitterImageUrl: () => {
150
- if (seoData.value.image && seoData.value.image.includes("?vars=")) {
151
- if (seoData.value.imageType) {
152
- return seoData.value.image.replace(
153
- "?vars=",
154
- `.${seoData.value.imageType}?vars=`,
155
- );
156
- } else {
157
- return seoData.value.image.replace("?vars=", ".png?vars=");
156
+ if (seoData.value.image) {
157
+ if (seoData.value.image.includes("?vars=")) {
158
+ if (seoData.value.imageType) {
159
+ return seoData.value.image.replace(
160
+ "?vars=",
161
+ `.${seoData.value.imageType}?vars=`,
162
+ );
163
+ } else {
164
+ return seoData.value.image.replace("?vars=", ".png?vars=");
165
+ }
158
166
  }
167
+ return seoData.value.image;
159
168
  }
160
- return seoData.value.image;
161
169
  },
162
170
  twitterImageType() {
163
171
  if (seoData.value.imageType) {
164
172
  return seoData.value.imageType
165
- ? "image/" + seoData.value.imageType
173
+ ? seoData.value.imageType.includes("image/")
174
+ ? seoData.value.imageType
175
+ : `image/${seoData.value.imageType}`
166
176
  : "image/png";
167
177
  }
168
178
  return undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fy-/fws-vue",
3
- "version": "2.0.21",
3
+ "version": "2.0.23",
4
4
  "author": "Florian 'Fy' Gasquez <m@fy.to>",
5
5
  "license": "MIT",
6
6
  "repository": {