@fy-/fws-vue 2.0.0 → 2.0.3

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 +31 -10
  2. package/package.json +1 -1
@@ -25,6 +25,7 @@ export interface LazyHead {
25
25
  canonical?: string;
26
26
  isAdult?: boolean;
27
27
  alternateLocales?: string[];
28
+ twitterCreator?: string;
28
29
  }
29
30
 
30
31
  export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
@@ -48,11 +49,6 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
48
49
  content: seoData.value.imageHeight,
49
50
  key: "og:image:height",
50
51
  });
51
- metas.push({
52
- name: "twitter:image:height",
53
- content: seoData.value.imageHeight,
54
- key: "twitter:image:height",
55
- });
56
52
  }
57
53
  if (seoData.value.imageWidth && seoData.value.image) {
58
54
  metas.push({
@@ -60,11 +56,6 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
60
56
  content: seoData.value.imageWidth,
61
57
  key: "og:image:width",
62
58
  });
63
- metas.push({
64
- name: "twitter:image:width",
65
- content: seoData.value.imageWidth,
66
- key: "twitter:image:width",
67
- });
68
59
  }
69
60
  if (seoData.value.imageType && seoData.value.image) {
70
61
  metas.push({
@@ -77,6 +68,17 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
77
68
  content: seoData.value.imageType,
78
69
  key: "twitter:image:type",
79
70
  });
71
+ } else if (seoData.value.image) {
72
+ metas.push({
73
+ property: "og:image:type",
74
+ content: "image/png",
75
+ key: "og:image:type",
76
+ });
77
+ metas.push({
78
+ name: "twitter:image:type",
79
+ content: "image/png",
80
+ key: "twitter:image:type",
81
+ });
80
82
  }
81
83
 
82
84
  return metas;
@@ -103,6 +105,15 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
103
105
  }
104
106
  });
105
107
 
108
+ if (seoData.value.image) {
109
+ links.push({
110
+ rel: "preload",
111
+ href: seoData.value.image,
112
+ as: "image",
113
+ fetchpriority: "high",
114
+ });
115
+ }
116
+
106
117
  return links;
107
118
  },
108
119
  });
@@ -116,9 +127,19 @@ export const useSeo = (seoData: Ref<LazyHead>, initial: boolean = false) => {
116
127
  ogDescription: () => seoData.value.description,
117
128
  ogImage: () => seoData.value.image,
118
129
  twitterCard: "summary_large_image",
130
+ ogSiteName: () => seoData.value.name,
119
131
  twitterTitle: () => seoData.value.title,
120
132
  twitterDescription: () => seoData.value.description,
121
133
  twitterImage: () => seoData.value.image,
134
+ ogImageAlt: () => {
135
+ if (seoData.value.image) {
136
+ return seoData.value.title;
137
+ }
138
+ return undefined;
139
+ },
140
+ ogType: () => (seoData.value.type ? seoData.value.type : "website"),
141
+ twitterCreator: () => seoData.value.twitterCreator,
142
+ twitterSite: () => seoData.value.twitterCreator,
122
143
  twitterImageAlt: () => {
123
144
  if (seoData.value.image) {
124
145
  return seoData.value.title;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fy-/fws-vue",
3
- "version": "2.0.00",
3
+ "version": "2.0.03",
4
4
  "author": "Florian 'Fy' Gasquez <m@fy.to>",
5
5
  "license": "MIT",
6
6
  "repository": {