@fy-/fws-vue 0.6.2 → 0.6.4

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 -8
  2. package/package.json +1 -1
@@ -105,10 +105,14 @@ export const useSeo = (seo: Ref<LazyHead>, initial: boolean = false) => {
105
105
  ];
106
106
 
107
107
  metaPairs.forEach(([seoKey, ...properties]) => {
108
- properties.forEach((property) => {
109
- if (seo.value[property as keyof LazyHead]) {
110
- console.log("property:", property);
111
- console.log("seokKey:", seoKey);
108
+ const seoValue = seo.value[seoKey as keyof LazyHead];
109
+ console.log(
110
+ `seoKey: ${seoKey}, properties: ${properties}, seoValue: ${seoValue}`,
111
+ );
112
+
113
+ if (seoValue !== undefined && seoValue !== null && seoValue !== "") {
114
+ properties.forEach((property) => {
115
+ console.log(`property: ${property}`);
112
116
  if (
113
117
  property === "description" ||
114
118
  property === "keywords" ||
@@ -116,18 +120,22 @@ export const useSeo = (seo: Ref<LazyHead>, initial: boolean = false) => {
116
120
  ) {
117
121
  metas.push({
118
122
  name: property,
119
- content: seo.value[seoKey as keyof LazyHead],
123
+ content: seoValue,
120
124
  });
121
125
  } else {
122
126
  metas.push({
123
127
  property,
124
- content: seo.value[seoKey as keyof LazyHead] as string,
128
+ content: seoValue as string,
125
129
  });
126
130
  }
127
- }
128
- });
131
+ });
132
+ }
129
133
  });
130
134
 
135
+ if (seo.value.description) {
136
+ metas.push({ name: "description", content: seo.value.description });
137
+ }
138
+
131
139
  return metas;
132
140
  }),
133
141
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fy-/fws-vue",
3
- "version": "0.6.2",
3
+ "version": "0.6.4",
4
4
  "author": "Florian 'Fy' Gasquez <m@fy.to>",
5
5
  "license": "MIT",
6
6
  "repository": {