nuxt-og-image 2.0.6 → 2.0.7
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/client/200.html +2 -2
- package/dist/client/404.html +2 -2
- package/dist/client/_nuxt/{IconCSS.acbfc761.js → IconCSS.444dbaf2.js} +1 -1
- package/dist/client/_nuxt/{ImageLoader.45e71895.js → ImageLoader.3238b676.js} +1 -1
- package/dist/client/_nuxt/{entry.f886005d.js → entry.fd330f13.js} +3 -3
- package/dist/client/_nuxt/{error-404.0a0b8ce2.js → error-404.01ee9ac3.js} +1 -1
- package/dist/client/_nuxt/{error-500.20847d33.js → error-500.f700afa0.js} +1 -1
- package/dist/client/_nuxt/{index.0cbeeabd.js → index.4bbde254.js} +1 -1
- package/dist/client/_nuxt/{options.1070a0ba.js → options.ed57f98c.js} +1 -1
- package/dist/client/_nuxt/{png.e3b1ce6b.js → png.31a238a6.js} +1 -1
- package/dist/client/_nuxt/{shiki.4671d705.js → shiki.87c664fb.js} +1 -1
- package/dist/client/_nuxt/{svg.26cfe41e.js → svg.45bd4aa7.js} +1 -1
- package/dist/client/_nuxt/{vnodes.7d34f085.js → vnodes.f494cd39.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +19 -14
- package/dist/runtime/cache.d.ts +4 -3
- package/dist/runtime/cache.mjs +1 -1
- package/dist/runtime/nitro/plugins/prerender.mjs +25 -16
- package/dist/runtime/nitro/routes/options.d.ts +2 -2
- package/dist/runtime/nitro/routes/options.mjs +5 -12
- package/dist/runtime/nitro/utils-pure.d.ts +1 -1
- package/dist/runtime/nitro/utils-pure.mjs +16 -11
- package/package.json +2 -2
|
@@ -11,7 +11,7 @@ function decodeObjectHtmlEntities(obj) {
|
|
|
11
11
|
});
|
|
12
12
|
return obj;
|
|
13
13
|
}
|
|
14
|
-
export function
|
|
14
|
+
export function extractAndNormaliseOgImageOptions(path, html, routeRules, defaults) {
|
|
15
15
|
const htmlPayload = html.match(/<script id="nuxt-og-image-options" type="application\/json">(.+?)<\/script>/)?.[1];
|
|
16
16
|
if (!htmlPayload)
|
|
17
17
|
return false;
|
|
@@ -28,15 +28,20 @@ export function extractOgImageOptions(html, routeRules) {
|
|
|
28
28
|
if (process.dev)
|
|
29
29
|
console.warn("Failed to parse #nuxt-og-image-options", e, options);
|
|
30
30
|
}
|
|
31
|
-
if (options)
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return decodeObjectHtmlEntities(options);
|
|
31
|
+
if (!options)
|
|
32
|
+
return false;
|
|
33
|
+
if (!options.description) {
|
|
34
|
+
const description = html.match(/<meta property="og:description" content="(.*?)">/)?.[1];
|
|
35
|
+
if (description)
|
|
36
|
+
options.description = description;
|
|
37
|
+
else
|
|
38
|
+
options.description = html.match(/<meta name="description" content="(.*?)">/)?.[1];
|
|
40
39
|
}
|
|
41
|
-
|
|
40
|
+
const decoded = decodeObjectHtmlEntities(options);
|
|
41
|
+
return defu(
|
|
42
|
+
decoded,
|
|
43
|
+
// runtime options
|
|
44
|
+
{ path },
|
|
45
|
+
defaults
|
|
46
|
+
);
|
|
42
47
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-og-image",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
5
|
-
"packageManager": "pnpm@8.6.
|
|
4
|
+
"version": "2.0.7",
|
|
5
|
+
"packageManager": "pnpm@8.6.7",
|
|
6
6
|
"description": "Enlightened OG Image generation for Nuxt.",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"funding": "https://github.com/sponsors/harlan-zw",
|