vatts 1.0.2-alpha.4 → 1.0.2-alpha.5
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.
- package/dist/renderer.js +37 -0
- package/package.json +1 -1
package/dist/renderer.js
CHANGED
|
@@ -62,6 +62,12 @@ function generateMetaTags(metadata) {
|
|
|
62
62
|
tags.push(`<link rel="canonical" href="${metadata.canonical}">`);
|
|
63
63
|
if (metadata.favicon)
|
|
64
64
|
tags.push(`<link rel="icon" href="${metadata.favicon}">`);
|
|
65
|
+
// Apple & Manifest
|
|
66
|
+
if (metadata.appleTouchIcon)
|
|
67
|
+
tags.push(`<link rel="apple-touch-icon" href="${metadata.appleTouchIcon}">`);
|
|
68
|
+
if (metadata.manifest)
|
|
69
|
+
tags.push(`<link rel="manifest" href="${metadata.manifest}">`);
|
|
70
|
+
// Open Graph
|
|
65
71
|
if (metadata.openGraph) {
|
|
66
72
|
const og = metadata.openGraph;
|
|
67
73
|
if (og.title)
|
|
@@ -72,11 +78,42 @@ function generateMetaTags(metadata) {
|
|
|
72
78
|
tags.push(`<meta property="og:type" content="${og.type}">`);
|
|
73
79
|
if (og.url)
|
|
74
80
|
tags.push(`<meta property="og:url" content="${og.url}">`);
|
|
81
|
+
if (og.siteName)
|
|
82
|
+
tags.push(`<meta property="og:site_name" content="${og.siteName}">`);
|
|
83
|
+
if (og.locale)
|
|
84
|
+
tags.push(`<meta property="og:locale" content="${og.locale}">`);
|
|
75
85
|
if (og.image) {
|
|
76
86
|
const imgUrl = typeof og.image === 'string' ? og.image : og.image.url;
|
|
77
87
|
tags.push(`<meta property="og:image" content="${imgUrl}">`);
|
|
88
|
+
if (typeof og.image !== 'string') {
|
|
89
|
+
if (og.image.width)
|
|
90
|
+
tags.push(`<meta property="og:image:width" content="${og.image.width}">`);
|
|
91
|
+
if (og.image.height)
|
|
92
|
+
tags.push(`<meta property="og:image:height" content="${og.image.height}">`);
|
|
93
|
+
if (og.image.alt)
|
|
94
|
+
tags.push(`<meta property="og:image:alt" content="${og.image.alt}">`);
|
|
95
|
+
}
|
|
78
96
|
}
|
|
79
97
|
}
|
|
98
|
+
// Twitter Card
|
|
99
|
+
if (metadata.twitter) {
|
|
100
|
+
const tw = metadata.twitter;
|
|
101
|
+
if (tw.card)
|
|
102
|
+
tags.push(`<meta name="twitter:card" content="${tw.card}">`);
|
|
103
|
+
if (tw.site)
|
|
104
|
+
tags.push(`<meta name="twitter:site" content="${tw.site}">`);
|
|
105
|
+
if (tw.creator)
|
|
106
|
+
tags.push(`<meta name="twitter:creator" content="${tw.creator}">`);
|
|
107
|
+
if (tw.title)
|
|
108
|
+
tags.push(`<meta name="twitter:title" content="${tw.title}">`);
|
|
109
|
+
if (tw.description)
|
|
110
|
+
tags.push(`<meta name="twitter:description" content="${tw.description}">`);
|
|
111
|
+
if (tw.image)
|
|
112
|
+
tags.push(`<meta name="twitter:image" content="${tw.image}">`);
|
|
113
|
+
if (tw.imageAlt)
|
|
114
|
+
tags.push(`<meta name="twitter:image:alt" content="${tw.imageAlt}">`);
|
|
115
|
+
}
|
|
116
|
+
// Custom Meta Tags
|
|
80
117
|
if (metadata.other) {
|
|
81
118
|
for (const [key, value] of Object.entries(metadata.other)) {
|
|
82
119
|
tags.push(`<meta name="${key}" content="${value}">`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vatts",
|
|
3
|
-
"version": "1.0.2-alpha.
|
|
3
|
+
"version": "1.0.2-alpha.5",
|
|
4
4
|
"description": "Vatts.js is a high-level framework for building web applications with ease and speed. It provides a robust set of tools and features to streamline development and enhance productivity.",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"author": "itsmuzin",
|