nuxt-og-image 3.0.7 → 3.0.9
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/LICENSE.md +9 -0
- package/README.md +31 -20
- package/dist/client/200.html +81 -77
- package/dist/client/404.html +81 -77
- package/dist/client/_nuxt/{CE0v8NN9.js → 0qbUsQ6_.js} +1 -1
- package/dist/client/_nuxt/2aygx1xg.js +1 -0
- package/dist/client/_nuxt/{DBxrVw_D.js → 5Vw9JATd.js} +1 -1
- package/dist/client/_nuxt/6RUVFG9U.js +1 -0
- package/dist/client/_nuxt/B1Z2YEe0.js +1 -0
- package/dist/client/_nuxt/{OiuHoWY5.js → B1rsb5QC.js} +1 -1
- package/dist/client/_nuxt/B2uSYIFn.js +1 -0
- package/dist/client/_nuxt/BA1ndEPy.js +1 -0
- package/dist/client/_nuxt/{p-youoOz.js → BCawSwWi.js} +1 -1
- package/dist/client/_nuxt/{rAPcFIiw.js → BYqZ7etr.js} +1 -1
- package/dist/client/_nuxt/{BjE2mIY4.js → BbalPOsb.js} +1 -1
- package/dist/client/_nuxt/{DwFwdhDE.js → Bcw97oti.js} +1 -1
- package/dist/client/_nuxt/{CiXlrwC7.js → BhC5s0V7.js} +1 -1
- package/dist/client/_nuxt/{BVLG6Y-w.js → Bmb0A568.js} +1 -1
- package/dist/client/_nuxt/{DpVQgTom.js → BoZcIFWd.js} +1 -1
- package/dist/client/_nuxt/BqtQrzRp.js +1 -0
- package/dist/client/_nuxt/{BWgb8Pxw.js → Bv_sPlCv.js} +1 -1
- package/dist/client/_nuxt/BwpQXVS2.js +1 -0
- package/dist/client/_nuxt/By_ruW9X.js +3834 -0
- package/dist/client/_nuxt/C-_shW-Y.js +1 -0
- package/dist/client/_nuxt/{nkNqggyT.js → CBzZD_Xh.js} +1 -1
- package/dist/client/_nuxt/CD_QflpE.js +1 -0
- package/dist/client/_nuxt/{Bpo8LMpD.js → CI15r38m.js} +1 -1
- package/dist/client/_nuxt/{JbneklYT.js → CK7S-5jS.js} +1 -1
- package/dist/client/_nuxt/{B9hcNGex.js → CKfqYE_r.js} +1 -1
- package/dist/client/_nuxt/CLXkKSjS.js +1 -0
- package/dist/client/_nuxt/CM4fc1WH.js +1 -0
- package/dist/client/_nuxt/{1EdnXNuB.js → CSc2nTFY.js} +1 -1
- package/dist/client/_nuxt/CVESyXxo.js +1 -0
- package/dist/client/_nuxt/{vFtNXPBc.js → CWJejSyX.js} +1 -1
- package/dist/client/_nuxt/{Bt50SWsh.js → CY2R9RuK.js} +1 -1
- package/dist/client/_nuxt/{Ckz-YMxz.js → CeZwWGti.js} +1 -1
- package/dist/client/_nuxt/CjDtw9vr.js +1 -0
- package/dist/client/_nuxt/{BhLNiG9c.js → ClV7KpCc.js} +1 -1
- package/dist/client/_nuxt/{D7z58M2W.js → Cm25um3E.js} +1 -1
- package/dist/client/_nuxt/CmCqftbK.js +1 -0
- package/dist/client/_nuxt/Cmhojp3q.js +1 -0
- package/dist/client/_nuxt/{BwojPDJW.js → CnsmiicP.js} +1 -1
- package/dist/client/_nuxt/{DCRAZVCM.js → CodIOJDM.js} +1 -1
- package/dist/client/_nuxt/{0e7srHXh.js → Csvi84BS.js} +1 -1
- package/dist/client/_nuxt/{CHZeBJpW.js → CuIYtGag.js} +1 -1
- package/dist/client/_nuxt/{I1uqSxRv.js → Cv3cJnDV.js} +1 -1
- package/dist/client/_nuxt/Cv7ZOjGq.js +1 -0
- package/dist/client/_nuxt/{BMGF3Z6I.js → CwIwlfa-.js} +1 -1
- package/dist/client/_nuxt/{Da_8ueAw.js → CyEc264g.js} +1 -1
- package/dist/client/_nuxt/{CRR3mLlZ.js → D2O4HAMr.js} +1 -1
- package/dist/client/_nuxt/{Bexp5DGn.js → DFQ4Xr-4.js} +1 -1
- package/dist/client/_nuxt/DMFdBl0X.js +1 -0
- package/dist/client/_nuxt/DNgb01dh.js +1 -0
- package/dist/client/_nuxt/DRW-0cLl.js +1 -0
- package/dist/client/_nuxt/{Xse1gjxk.js → DRhUEtVu.js} +1 -1
- package/dist/client/_nuxt/{BGdveAQA.js → DUdzsfxe.js} +1 -1
- package/dist/client/_nuxt/{CYyBA3kJ.js → Db-JQHi3.js} +1 -1
- package/dist/client/_nuxt/DepYB8Ml.js +1 -0
- package/dist/client/_nuxt/{ChEme8PX.js → DhG9BCpW.js} +1 -1
- package/dist/client/_nuxt/{BxJadH_W.js → DhqJCFIX.js} +1 -1
- package/dist/client/_nuxt/DqpEK-75.js +1 -0
- package/dist/client/_nuxt/Ds-gbosJ.js +1 -0
- package/dist/client/_nuxt/{D4O64OTH.js → DvA-6Bhw.js} +1 -1
- package/dist/client/_nuxt/{B66eQrDP.js → FMvz1E70.js} +1 -1
- package/dist/client/_nuxt/GBQ2dnAY.js +1 -0
- package/dist/client/_nuxt/{CJrM-UL-.js → JJNjxVar.js} +1 -1
- package/dist/client/_nuxt/{D_QQB6Yv.js → KUYRHWK4.js} +1 -1
- package/dist/client/_nuxt/LGGdnPYs.js +1 -0
- package/dist/client/_nuxt/Lp17StYA.js +1 -0
- package/dist/client/_nuxt/RXHOmnpW.js +1 -0
- package/dist/client/_nuxt/{4NJYcRSJ.js → W2lx4xae.js} +1 -1
- package/dist/client/_nuxt/YurBl9Qv.js +1 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/d9a165f2-5e19-460e-be70-9359a1d41711.json +1 -0
- package/dist/client/_nuxt/{D0ybgVpa.js → dwbxrGt_.js} +1 -1
- package/dist/client/_nuxt/{D3CL8VSI.js → eACALr6E.js} +1 -1
- package/dist/client/_nuxt/error-404.DGYJY-kl.css +1 -0
- package/dist/client/_nuxt/error-500.BTkdHbNU.css +1 -0
- package/dist/client/_nuxt/{B8E_5cfo.js → gOa3Yz9U.js} +1 -1
- package/dist/client/_nuxt/{BbzkbZ9e.js → i22b9gbM.js} +1 -1
- package/dist/client/_nuxt/{g_GSZ1hr.js → u4bm_LMz.js} +1 -1
- package/dist/client/_nuxt/{A13Lx_ye.js → vocl-2a6.js} +1 -1
- package/dist/client/_nuxt/{CN6rGqjK.js → xfgw03QH.js} +1 -1
- package/dist/client/_nuxt/zchoCBdH.js +1 -0
- package/dist/client/index.html +81 -77
- package/dist/module.json +1 -1
- package/dist/module.mjs +27 -23
- package/dist/runtime/{nuxt → app}/components/Templates/Community/NuxtSeo.vue +1 -1
- package/dist/runtime/{nuxt → app}/composables/defineOgImage.js +1 -1
- package/dist/runtime/{nuxt → app}/composables/defineOgImageComponent.d.ts +1 -1
- package/dist/runtime/{nuxt → app}/composables/mock.d.ts +1 -1
- package/dist/runtime/{nuxt → app}/utils/plugins.js +1 -1
- package/dist/runtime/{nitro → server}/og-image/chromium/renderer.js +1 -1
- package/dist/runtime/{nitro → server}/og-image/context.js +2 -2
- package/dist/runtime/{nitro → server}/og-image/instances.js +2 -2
- package/dist/runtime/{nitro → server}/og-image/satori/instances.js +4 -4
- package/dist/runtime/{nitro → server}/og-image/satori/plugins/unocss.js +1 -1
- package/dist/runtime/{nitro → server}/og-image/satori/renderer.js +16 -14
- package/dist/runtime/{nitro → server}/og-image/satori/transforms/emojis.js +1 -1
- package/dist/runtime/{nitro → server}/og-image/templates/html.js +1 -1
- package/dist/runtime/server/plugins/__zero-runtime/nuxt-content.d.ts +2 -0
- package/dist/runtime/{nitro → server}/plugins/__zero-runtime/nuxt-content.js +1 -1
- package/dist/runtime/server/plugins/nuxt-content.d.ts +2 -0
- package/dist/runtime/{nitro → server}/plugins/nuxt-content.js +1 -1
- package/dist/runtime/server/plugins/prerender.d.ts +2 -0
- package/dist/runtime/{nitro → server}/plugins/prerender.js +2 -2
- package/dist/runtime/{nitro → server}/routes/debug.json.js +2 -2
- package/dist/runtime/{nitro → server}/util/options.js +1 -1
- package/dist/runtime/{nitro → server}/util/plugins.js +8 -4
- package/dist/runtime/types.d.ts +3 -1
- package/package.json +41 -38
- package/virtual.d.ts +30 -8
- package/dist/client/_nuxt/35JD59R_.js +0 -1
- package/dist/client/_nuxt/9xzcv9xf.js +0 -1
- package/dist/client/_nuxt/B-GI89LT.js +0 -1
- package/dist/client/_nuxt/BStEqDGx.js +0 -1
- package/dist/client/_nuxt/BT8b6B_-.js +0 -1
- package/dist/client/_nuxt/BTo9ix6S.js +0 -1
- package/dist/client/_nuxt/BeSffZBD.js +0 -1
- package/dist/client/_nuxt/Begb3drz.js +0 -1
- package/dist/client/_nuxt/C3t61SNw.js +0 -1
- package/dist/client/_nuxt/COtMjVi7.js +0 -1
- package/dist/client/_nuxt/C_OO3DVV.js +0 -1
- package/dist/client/_nuxt/Cn_j0ne6.js +0 -1
- package/dist/client/_nuxt/D5gt1ch3.js +0 -1
- package/dist/client/_nuxt/D6HQHXJE.js +0 -1
- package/dist/client/_nuxt/DIvA8ll9.js +0 -1
- package/dist/client/_nuxt/DQJjjPvk.js +0 -1
- package/dist/client/_nuxt/DWt6wkI-.js +0 -1
- package/dist/client/_nuxt/DanlQboj.js +0 -1
- package/dist/client/_nuxt/DnBisYsJ.js +0 -3826
- package/dist/client/_nuxt/Dt1_zKdO.js +0 -1
- package/dist/client/_nuxt/Jwd9j1ay.js +0 -1
- package/dist/client/_nuxt/NfFGm2lL.js +0 -1
- package/dist/client/_nuxt/S_yhxdK1.js +0 -1
- package/dist/client/_nuxt/builds/meta/7b5267c6-e23f-4386-bec3-f9adec39833b.json +0 -1
- package/dist/client/_nuxt/eCoydtrh.js +0 -1
- package/dist/client/_nuxt/error-404.D4k1dunI.css +0 -1
- package/dist/client/_nuxt/error-500.Q7NSr7sn.css +0 -1
- package/dist/client/_nuxt/keK8bHwS.js +0 -1
- package/dist/runtime/nitro/plugins/__zero-runtime/nuxt-content.d.ts +0 -2
- package/dist/runtime/nitro/plugins/nuxt-content.d.ts +0 -2
- package/dist/runtime/nitro/plugins/prerender.d.ts +0 -2
- /package/dist/runtime/{nuxt → app}/components/OgImage/OgImage.d.ts +0 -0
- /package/dist/runtime/{nuxt → app}/components/OgImage/OgImage.js +0 -0
- /package/dist/runtime/{nuxt → app}/components/OgImage/OgImageScreenshot.d.ts +0 -0
- /package/dist/runtime/{nuxt → app}/components/OgImage/OgImageScreenshot.js +0 -0
- /package/dist/runtime/{nuxt → app}/components/Templates/Community/BrandedLogo.vue +0 -0
- /package/dist/runtime/{nuxt → app}/components/Templates/Community/Frame.vue +0 -0
- /package/dist/runtime/{nuxt → app}/components/Templates/Community/Nuxt.vue +0 -0
- /package/dist/runtime/{nuxt → app}/components/Templates/Community/Pergel.vue +0 -0
- /package/dist/runtime/{nuxt → app}/components/Templates/Community/SimpleBlog.vue +0 -0
- /package/dist/runtime/{nuxt → app}/components/Templates/Community/UnJs.vue +0 -0
- /package/dist/runtime/{nuxt → app}/components/Templates/Community/Wave.vue +0 -0
- /package/dist/runtime/{nuxt → app}/components/Templates/Community/WithEmoji.vue +0 -0
- /package/dist/runtime/{nuxt → app}/composables/defineOgImage.d.ts +0 -0
- /package/dist/runtime/{nuxt → app}/composables/defineOgImageComponent.js +0 -0
- /package/dist/runtime/{nuxt → app}/composables/defineOgImageScreenshot.d.ts +0 -0
- /package/dist/runtime/{nuxt → app}/composables/defineOgImageScreenshot.js +0 -0
- /package/dist/runtime/{nuxt → app}/composables/mock.js +0 -0
- /package/dist/runtime/{nuxt → app}/plugins/__zero-runtime/og-image-canonical-urls.server.d.ts +0 -0
- /package/dist/runtime/{nuxt → app}/plugins/__zero-runtime/og-image-canonical-urls.server.js +0 -0
- /package/dist/runtime/{nuxt → app}/plugins/__zero-runtime/route-rule-og-image.server.d.ts +0 -0
- /package/dist/runtime/{nuxt → app}/plugins/__zero-runtime/route-rule-og-image.server.js +0 -0
- /package/dist/runtime/{nuxt → app}/plugins/og-image-canonical-urls.server.d.ts +0 -0
- /package/dist/runtime/{nuxt → app}/plugins/og-image-canonical-urls.server.js +0 -0
- /package/dist/runtime/{nuxt → app}/plugins/route-rule-og-image.server.d.ts +0 -0
- /package/dist/runtime/{nuxt → app}/plugins/route-rule-og-image.server.js +0 -0
- /package/dist/runtime/{nuxt → app}/utils/plugins.d.ts +0 -0
- /package/dist/runtime/{nuxt → app}/utils.d.ts +0 -0
- /package/dist/runtime/{nuxt → app}/utils.js +0 -0
- /package/dist/runtime/{nitro → server}/og-image/bindings/chromium/chrome-launcher.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/bindings/chromium/chrome-launcher.js +0 -0
- /package/dist/runtime/{nitro → server}/og-image/bindings/chromium/on-demand.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/bindings/chromium/on-demand.js +0 -0
- /package/dist/runtime/{nitro → server}/og-image/bindings/chromium/playwright.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/bindings/chromium/playwright.js +0 -0
- /package/dist/runtime/{nitro → server}/og-image/bindings/css-inline/node.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/bindings/css-inline/node.js +0 -0
- /package/dist/runtime/{nitro → server}/og-image/bindings/css-inline/wasm-fs.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/bindings/css-inline/wasm-fs.js +0 -0
- /package/dist/runtime/{nitro → server}/og-image/bindings/css-inline/wasm.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/bindings/css-inline/wasm.js +0 -0
- /package/dist/runtime/{nitro → server}/og-image/bindings/resvg/node.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/bindings/resvg/node.js +0 -0
- /package/dist/runtime/{nitro → server}/og-image/bindings/resvg/wasm-fs.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/bindings/resvg/wasm-fs.js +0 -0
- /package/dist/runtime/{nitro → server}/og-image/bindings/resvg/wasm.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/bindings/resvg/wasm.js +0 -0
- /package/dist/runtime/{nitro → server}/og-image/bindings/satori/node.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/bindings/satori/node.js +0 -0
- /package/dist/runtime/{nitro → server}/og-image/bindings/satori/wasm-fs.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/bindings/satori/wasm-fs.js +0 -0
- /package/dist/runtime/{nitro → server}/og-image/bindings/satori/wasm.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/bindings/satori/wasm.js +0 -0
- /package/dist/runtime/{nitro → server}/og-image/bindings/sharp/node.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/bindings/sharp/node.js +0 -0
- /package/dist/runtime/{nitro → server}/og-image/cache/lru.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/cache/lru.js +0 -0
- /package/dist/runtime/{nitro → server}/og-image/cache/mock.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/cache/mock.js +0 -0
- /package/dist/runtime/{nitro → server}/og-image/chromium/renderer.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/chromium/screenshot.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/chromium/screenshot.js +0 -0
- /package/dist/runtime/{nitro → server}/og-image/context.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/instances.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/satori/font.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/satori/font.js +0 -0
- /package/dist/runtime/{nitro → server}/og-image/satori/instances.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/satori/plugins/classes.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/satori/plugins/classes.js +0 -0
- /package/dist/runtime/{nitro → server}/og-image/satori/plugins/emojis.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/satori/plugins/emojis.js +0 -0
- /package/dist/runtime/{nitro → server}/og-image/satori/plugins/encoding.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/satori/plugins/encoding.js +0 -0
- /package/dist/runtime/{nitro → server}/og-image/satori/plugins/flex.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/satori/plugins/flex.js +0 -0
- /package/dist/runtime/{nitro → server}/og-image/satori/plugins/imageSrc.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/satori/plugins/imageSrc.js +0 -0
- /package/dist/runtime/{nitro → server}/og-image/satori/plugins/unocss.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/satori/renderer.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/satori/transforms/emojis.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/satori/transforms/inlineCss.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/satori/transforms/inlineCss.js +0 -0
- /package/dist/runtime/{nitro → server}/og-image/satori/utils.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/satori/utils.js +0 -0
- /package/dist/runtime/{nitro → server}/og-image/satori/vnodes.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/og-image/satori/vnodes.js +0 -0
- /package/dist/runtime/{nitro → server}/og-image/templates/html.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/routes/__zero-runtime/font.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/routes/__zero-runtime/font.js +0 -0
- /package/dist/runtime/{nitro → server}/routes/__zero-runtime/image.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/routes/__zero-runtime/image.js +0 -0
- /package/dist/runtime/{nitro → server}/routes/debug.json.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/routes/font.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/routes/font.js +0 -0
- /package/dist/runtime/{nitro → server}/routes/image.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/routes/image.js +0 -0
- /package/dist/runtime/{nitro → server}/tsconfig.json +0 -0
- /package/dist/runtime/{nitro → server}/util/cache.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/util/cache.js +0 -0
- /package/dist/runtime/{nitro → server}/util/encoding.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/util/encoding.js +0 -0
- /package/dist/runtime/{nitro → server}/util/eventHandlers.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/util/eventHandlers.js +0 -0
- /package/dist/runtime/{nitro → server}/util/kit.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/util/kit.js +0 -0
- /package/dist/runtime/{nitro → server}/util/logger.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/util/logger.js +0 -0
- /package/dist/runtime/{nitro → server}/util/options.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/util/plugins.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/util/wasm.d.ts +0 -0
- /package/dist/runtime/{nitro → server}/util/wasm.js +0 -0
package/dist/module.mjs
CHANGED
|
@@ -143,8 +143,8 @@ async function applyNitroPresetCompatibility(nitroConfig, options) {
|
|
|
143
143
|
const { resolve } = options;
|
|
144
144
|
const satoriEnabled = typeof options.compatibility?.satori !== "undefined" ? !!options.compatibility.satori : !!compatibility.satori;
|
|
145
145
|
const chromiumEnabled = typeof options.compatibility?.chromium !== "undefined" ? !!options.compatibility.chromium : !!compatibility.chromium;
|
|
146
|
-
nitroConfig.alias["#
|
|
147
|
-
nitroConfig.alias["#
|
|
146
|
+
nitroConfig.alias["#og-image/renderers/satori"] = satoriEnabled ? resolve("./runtime/server/og-image/satori/renderer") : "unenv/runtime/mock/empty";
|
|
147
|
+
nitroConfig.alias["#og-image/renderers/chromium"] = chromiumEnabled ? resolve("./runtime/server/og-image/chromium/renderer") : "unenv/runtime/mock/empty";
|
|
148
148
|
const resolvedCompatibility = {};
|
|
149
149
|
function applyBinding(key) {
|
|
150
150
|
let binding = options.compatibility?.[key];
|
|
@@ -159,7 +159,7 @@ async function applyNitroPresetCompatibility(nitroConfig, options) {
|
|
|
159
159
|
}
|
|
160
160
|
resolvedCompatibility[key] = binding;
|
|
161
161
|
return {
|
|
162
|
-
[`#
|
|
162
|
+
[`#og-image/bindings/${key}`]: binding === false ? "unenv/runtime/mock/empty" : resolve(`./runtime/server/og-image/bindings/${key}/${binding}`)
|
|
163
163
|
};
|
|
164
164
|
}
|
|
165
165
|
nitroConfig.alias = defu(
|
|
@@ -176,7 +176,7 @@ async function applyNitroPresetCompatibility(nitroConfig, options) {
|
|
|
176
176
|
}
|
|
177
177
|
nitroConfig.rollupConfig = nitroConfig.rollupConfig || {};
|
|
178
178
|
nitroConfig.wasm = defu(compatibility.wasm, nitroConfig.wasm);
|
|
179
|
-
nitroConfig.virtual["#
|
|
179
|
+
nitroConfig.virtual["#og-image/compatibility"] = () => `export default ${JSON.stringify(resolvedCompatibility)}`;
|
|
180
180
|
addTemplate({
|
|
181
181
|
filename: "nuxt-og-image/compatibility.mjs",
|
|
182
182
|
getContents() {
|
|
@@ -210,6 +210,8 @@ async function setupBuildHandler(config, resolve, nuxt = useNuxt()) {
|
|
|
210
210
|
const target = resolveNitroPreset(nitro.options);
|
|
211
211
|
const isCloudflarePagesOrModule = target === "cloudflare-pages" || target === "cloudflare-module";
|
|
212
212
|
if (isCloudflarePagesOrModule) {
|
|
213
|
+
nitro.options.cloudflare = nitro.options.cloudflare || {};
|
|
214
|
+
nitro.options.cloudflare.pages = nitro.options.cloudflare.pages || {};
|
|
213
215
|
nitro.options.cloudflare.pages.routes = nitro.options.cloudflare.pages.routes || { exclude: [] };
|
|
214
216
|
nitro.options.cloudflare.pages.routes.exclude = nitro.options.cloudflare.pages.routes.exclude || [];
|
|
215
217
|
nitro.options.cloudflare.pages.routes.exclude.push("/__og-image__/static/*");
|
|
@@ -283,7 +285,7 @@ function setupDevToolsUI(options, resolve, nuxt = useNuxt()) {
|
|
|
283
285
|
const rpc = extendServerRpc("nuxt-og-image", {});
|
|
284
286
|
nuxt.hook("builder:watch", (e, path) => {
|
|
285
287
|
path = relative(nuxt.options.srcDir, resolve(nuxt.options.srcDir, path));
|
|
286
|
-
if ((e === "change" || e.includes("link")) && path.startsWith("pages")) {
|
|
288
|
+
if ((e === "change" || e.includes("link")) && (path.startsWith("pages") || path.startsWith("content"))) {
|
|
287
289
|
rpc.broadcast.refreshRouteData(path).catch(() => {
|
|
288
290
|
});
|
|
289
291
|
}
|
|
@@ -561,7 +563,7 @@ const module = defineNuxtModule({
|
|
|
561
563
|
if (config.enabled === false) {
|
|
562
564
|
logger.debug("The module is disabled, skipping setup.");
|
|
563
565
|
["defineOgImage", "defineOgImageComponent", "defineOgImageScreenshot"].forEach((name2) => {
|
|
564
|
-
addImports({ name: name2, from: resolve(`./runtime/
|
|
566
|
+
addImports({ name: name2, from: resolve(`./runtime/app/composables/mock`) });
|
|
565
567
|
});
|
|
566
568
|
return;
|
|
567
569
|
}
|
|
@@ -569,8 +571,8 @@ const module = defineNuxtModule({
|
|
|
569
571
|
logger.warn("Nuxt OG Image is enabled but SSR is disabled.\n\nYou should enable SSR (`ssr: true`) or disable the module (`ogImage: { enabled: false }`).");
|
|
570
572
|
return;
|
|
571
573
|
}
|
|
572
|
-
nuxt.options.alias["#
|
|
573
|
-
nuxt.options.alias["#
|
|
574
|
+
nuxt.options.alias["#og-image"] = resolve("./runtime");
|
|
575
|
+
nuxt.options.alias["#og-image-cache"] = resolve("./runtime/server/og-image/cache/lru");
|
|
574
576
|
const preset = resolveNitroPreset(nuxt.options.nitro);
|
|
575
577
|
const targetCompatibility = getPresetNitroPresetCompatibility(preset);
|
|
576
578
|
if (config.zeroRuntime) {
|
|
@@ -583,7 +585,7 @@ const module = defineNuxtModule({
|
|
|
583
585
|
});
|
|
584
586
|
if (!nuxt.options.dev) {
|
|
585
587
|
addBuildPlugin(TreeShakeComposablesPlugin, { server: true, client: true, build: true });
|
|
586
|
-
nuxt.options.alias["#
|
|
588
|
+
nuxt.options.alias["#og-image-cache"] = resolve("./runtime/server/og-image/cache/mock");
|
|
587
589
|
}
|
|
588
590
|
}
|
|
589
591
|
let isUsingSharp = false;
|
|
@@ -650,7 +652,7 @@ const module = defineNuxtModule({
|
|
|
650
652
|
});
|
|
651
653
|
await installNuxtSiteConfig();
|
|
652
654
|
if (hasNuxtModule("@nuxt/content")) {
|
|
653
|
-
addServerPlugin(resolve("./runtime/
|
|
655
|
+
addServerPlugin(resolve("./runtime/server/plugins/nuxt-content"));
|
|
654
656
|
}
|
|
655
657
|
if (!config.fonts.length) {
|
|
656
658
|
config.fonts = [
|
|
@@ -711,7 +713,7 @@ const module = defineNuxtModule({
|
|
|
711
713
|
nuxt.options.nitro.serverAssets.push({ baseName: "nuxt-og-image:fonts", dir: serverFontsDir });
|
|
712
714
|
}
|
|
713
715
|
nuxt.options.experimental.componentIslands ||= true;
|
|
714
|
-
const basePath = config.zeroRuntime ? "./runtime/
|
|
716
|
+
const basePath = config.zeroRuntime ? "./runtime/server/routes/__zero-runtime" : "./runtime/server/routes";
|
|
715
717
|
addServerHandler({
|
|
716
718
|
lazy: true,
|
|
717
719
|
route: "/__og-image__/font/**",
|
|
@@ -721,7 +723,7 @@ const module = defineNuxtModule({
|
|
|
721
723
|
addServerHandler({
|
|
722
724
|
lazy: true,
|
|
723
725
|
route: "/__og-image__/debug.json",
|
|
724
|
-
handler: resolve("./runtime/
|
|
726
|
+
handler: resolve("./runtime/server/routes/debug.json")
|
|
725
727
|
});
|
|
726
728
|
}
|
|
727
729
|
addServerHandler({
|
|
@@ -738,13 +740,13 @@ const module = defineNuxtModule({
|
|
|
738
740
|
["defineOgImage", "defineOgImageComponent", "defineOgImageScreenshot"].forEach((name2) => {
|
|
739
741
|
addImports({
|
|
740
742
|
name: name2,
|
|
741
|
-
from: resolve(`./runtime/
|
|
743
|
+
from: resolve(`./runtime/app/composables/${name2}`)
|
|
742
744
|
});
|
|
743
745
|
nuxt.options.optimization.treeShake.composables.client["nuxt-og-image"].push(name2);
|
|
744
746
|
});
|
|
745
747
|
if (!config.zeroRuntime || nuxt.options.dev) {
|
|
746
748
|
await addComponentsDir({
|
|
747
|
-
path: resolve("./runtime/
|
|
749
|
+
path: resolve("./runtime/app/components/Templates/Community"),
|
|
748
750
|
island: true
|
|
749
751
|
// watch: true,
|
|
750
752
|
});
|
|
@@ -756,11 +758,11 @@ const module = defineNuxtModule({
|
|
|
756
758
|
].forEach((name2) => {
|
|
757
759
|
addComponent({
|
|
758
760
|
name: name2,
|
|
759
|
-
filePath: resolve(`./runtime/
|
|
761
|
+
filePath: resolve(`./runtime/app/components/OgImage/${name2}`),
|
|
760
762
|
...config.componentOptions
|
|
761
763
|
});
|
|
762
764
|
});
|
|
763
|
-
const basePluginPath = `./runtime/
|
|
765
|
+
const basePluginPath = `./runtime/app/plugins${config.zeroRuntime ? "/__zero-runtime" : ""}`;
|
|
764
766
|
addPlugin({ mode: "server", src: resolve(`${basePluginPath}/route-rule-og-image.server`) });
|
|
765
767
|
addPlugin({ mode: "server", src: resolve(`${basePluginPath}/og-image-canonical-urls.server`) });
|
|
766
768
|
const ogImageComponentCtx = { components: [] };
|
|
@@ -773,13 +775,13 @@ const module = defineNuxtModule({
|
|
|
773
775
|
valid = true;
|
|
774
776
|
}
|
|
775
777
|
});
|
|
776
|
-
if (component.filePath.includes(resolve("./runtime/
|
|
778
|
+
if (component.filePath.includes(resolve("./runtime/app/components/Templates")))
|
|
777
779
|
valid = true;
|
|
778
780
|
if (valid && fs.existsSync(component.filePath)) {
|
|
779
781
|
component.island = true;
|
|
780
782
|
component.mode = "server";
|
|
781
783
|
let category = "app";
|
|
782
|
-
if (component.filePath.includes(resolve("./runtime/
|
|
784
|
+
if (component.filePath.includes(resolve("./runtime/app/components/Templates/Community")))
|
|
783
785
|
category = "community";
|
|
784
786
|
const componentFile = fs.readFileSync(component.filePath, "utf-8");
|
|
785
787
|
const credits = componentFile.split("\n").find((line) => line.startsWith(" * @credits"))?.replace("* @credits", "").trim();
|
|
@@ -804,7 +806,7 @@ const module = defineNuxtModule({
|
|
|
804
806
|
options: { mode: "server" }
|
|
805
807
|
});
|
|
806
808
|
nuxt.options.nitro.virtual = nuxt.options.nitro.virtual || {};
|
|
807
|
-
nuxt.options.nitro.virtual["#
|
|
809
|
+
nuxt.options.nitro.virtual["#og-image-virtual/component-names.mjs"] = () => {
|
|
808
810
|
return `export const componentNames = ${JSON.stringify(ogImageComponentCtx.components)}`;
|
|
809
811
|
};
|
|
810
812
|
let unoCssConfig = {};
|
|
@@ -814,7 +816,7 @@ const module = defineNuxtModule({
|
|
|
814
816
|
nuxt.hook("unocss:config", (_unoCssConfig) => {
|
|
815
817
|
unoCssConfig = { ..._unoCssConfig.theme };
|
|
816
818
|
});
|
|
817
|
-
nuxt.options.nitro.virtual["#
|
|
819
|
+
nuxt.options.nitro.virtual["#og-image-virtual/unocss-config.mjs"] = () => {
|
|
818
820
|
return `export const theme = ${JSON.stringify(unoCssConfig)}`;
|
|
819
821
|
};
|
|
820
822
|
extendTypes("nuxt-og-image", ({ typesPath }) => {
|
|
@@ -839,12 +841,12 @@ declare module 'nitropack' {
|
|
|
839
841
|
}
|
|
840
842
|
}
|
|
841
843
|
|
|
842
|
-
declare module '#
|
|
844
|
+
declare module '#og-image/components' {
|
|
843
845
|
export interface OgImageComponents {
|
|
844
846
|
${componentImports}
|
|
845
847
|
}
|
|
846
848
|
}
|
|
847
|
-
declare module '#
|
|
849
|
+
declare module '#og-image/unocss-config' {
|
|
848
850
|
export type theme = any
|
|
849
851
|
}
|
|
850
852
|
`;
|
|
@@ -887,6 +889,8 @@ declare module '#nuxt-og-image/unocss-config' {
|
|
|
887
889
|
fonts: normalisedFonts,
|
|
888
890
|
hasNuxtIcon: hasNuxtModule("nuxt-icon") || hasNuxtModule("@nuxt/icon"),
|
|
889
891
|
colorPreference,
|
|
892
|
+
hasNuxtContent: hasNuxtModule("@nuxt/content"),
|
|
893
|
+
strictNuxtContentPaths: config.strictNuxtContentPaths,
|
|
890
894
|
// @ts-expect-error runtime type
|
|
891
895
|
isNuxtContentDocumentDriven: config.strictNuxtContentPaths || !!nuxt.options.content?.documentDriven
|
|
892
896
|
};
|
|
@@ -902,7 +906,7 @@ declare module '#nuxt-og-image/unocss-config' {
|
|
|
902
906
|
await setupBuildHandler(config, resolve);
|
|
903
907
|
}
|
|
904
908
|
if (nuxt.options.build)
|
|
905
|
-
addServerPlugin(resolve("./runtime/
|
|
909
|
+
addServerPlugin(resolve("./runtime/server/plugins/prerender"));
|
|
906
910
|
setupPrerenderHandler(config, resolve);
|
|
907
911
|
}
|
|
908
912
|
});
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { useSiteConfig } from '#imports'
|
|
7
|
-
import { useOgImageRuntimeConfig } from '#
|
|
7
|
+
import { useOgImageRuntimeConfig } from '#og-image/shared'
|
|
8
8
|
import { computed, defineComponent, h, resolveComponent } from 'vue'
|
|
9
9
|
|
|
10
10
|
// convert to typescript props
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useNuxtApp, useRequestEvent, useRoute } from "#imports";
|
|
2
2
|
import { defu } from "defu";
|
|
3
3
|
import { appendHeader } from "h3";
|
|
4
|
-
import { createNitroRouteRuleMatcher } from "../../
|
|
4
|
+
import { createNitroRouteRuleMatcher } from "../../server/util/kit.js";
|
|
5
5
|
import { getOgImagePath, separateProps, useOgImageRuntimeConfig } from "../../shared.js";
|
|
6
6
|
import { createOgImageMeta, normaliseOptions } from "../utils.js";
|
|
7
7
|
export function defineOgImage(_options = {}) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { OgImageComponents } from '#
|
|
1
|
+
import type { OgImageComponents } from '#og-image/components';
|
|
2
2
|
import type { ExtractComponentProps, OgImageOptions } from '../../types.js';
|
|
3
3
|
export declare function defineOgImageComponent<T extends keyof OgImageComponents>(component: T, props?: Partial<ExtractComponentProps<OgImageComponents[T]>>, options?: OgImageOptions): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { OgImageComponents } from '#
|
|
1
|
+
import type { OgImageComponents } from '#og-image/components';
|
|
2
2
|
import type { DefineOgImageInput, ExtractComponentProps, OgImageOptions, OgImagePageScreenshotOptions } from '../../types.js';
|
|
3
3
|
export declare function defineOgImage(_options?: DefineOgImageInput): void;
|
|
4
4
|
export declare function defineOgImageComponent<T extends keyof OgImageComponents>(component: T, props?: Partial<ExtractComponentProps<OgImageComponents[T]>>, options?: OgImageOptions): void;
|
|
@@ -4,7 +4,7 @@ import { parse, stringify } from "devalue";
|
|
|
4
4
|
import { createRouter as createRadixRouter, toRouteMatcher } from "radix3";
|
|
5
5
|
import { parseURL, withoutBase } from "ufo";
|
|
6
6
|
import { toValue } from "vue";
|
|
7
|
-
import { createOgImageMeta, normaliseOptions } from "../../
|
|
7
|
+
import { createOgImageMeta, normaliseOptions } from "../../app/utils.js";
|
|
8
8
|
import { isInternalRoute, separateProps } from "../../pure.js";
|
|
9
9
|
import { getOgImagePath, useOgImageRuntimeConfig } from "../../shared.js";
|
|
10
10
|
export function ogImageCanonicalUrls(nuxtApp) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useNitroApp } from "#imports";
|
|
2
|
+
import { htmlPayloadCache, prerenderOptionsCache } from "#og-image-cache";
|
|
2
3
|
import { defu } from "defu";
|
|
3
4
|
import { parse } from "devalue";
|
|
4
5
|
import { createError, getQuery } from "h3";
|
|
5
|
-
import { useNitroApp } from "nitropack/runtime/app";
|
|
6
6
|
import { hash } from "ohash";
|
|
7
7
|
import { parseURL, withoutLeadingSlash, withoutTrailingSlash, withQuery } from "ufo";
|
|
8
8
|
import { normalizeKey } from "unstorage";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const satoriRendererInstance = { instance: void 0 };
|
|
2
2
|
const chromiumRendererInstance = { instance: void 0 };
|
|
3
3
|
export async function useSatoriRenderer() {
|
|
4
|
-
satoriRendererInstance.instance = satoriRendererInstance.instance || await import("#
|
|
4
|
+
satoriRendererInstance.instance = satoriRendererInstance.instance || await import("#og-image/renderers/satori").then((m) => m.default);
|
|
5
5
|
return satoriRendererInstance.instance;
|
|
6
6
|
}
|
|
7
7
|
export async function useChromiumRenderer() {
|
|
8
|
-
chromiumRendererInstance.instance = chromiumRendererInstance.instance || await import("#
|
|
8
|
+
chromiumRendererInstance.instance = chromiumRendererInstance.instance || await import("#og-image/renderers/chromium").then((m) => m.default);
|
|
9
9
|
return chromiumRendererInstance.instance;
|
|
10
10
|
}
|
|
@@ -3,21 +3,21 @@ const sharpInstance = { instance: void 0 };
|
|
|
3
3
|
const resvgInstance = { instance: void 0 };
|
|
4
4
|
const satoriInstance = { instance: void 0 };
|
|
5
5
|
export async function useResvg() {
|
|
6
|
-
resvgInstance.instance = resvgInstance.instance || await import("#
|
|
6
|
+
resvgInstance.instance = resvgInstance.instance || await import("#og-image/bindings/resvg").then((m) => m.default);
|
|
7
7
|
await resvgInstance.instance.initWasmPromise;
|
|
8
8
|
return resvgInstance.instance.Resvg;
|
|
9
9
|
}
|
|
10
10
|
export async function useSatori() {
|
|
11
|
-
satoriInstance.instance = satoriInstance.instance || await import("#
|
|
11
|
+
satoriInstance.instance = satoriInstance.instance || await import("#og-image/bindings/satori").then((m) => m.default);
|
|
12
12
|
await satoriInstance.instance.initWasmPromise;
|
|
13
13
|
return satoriInstance.instance.satori;
|
|
14
14
|
}
|
|
15
15
|
export async function useSharp() {
|
|
16
|
-
sharpInstance.instance = sharpInstance.instance || await import("#
|
|
16
|
+
sharpInstance.instance = sharpInstance.instance || await import("#og-image/bindings/sharp").then((m) => m.default);
|
|
17
17
|
return sharpInstance.instance;
|
|
18
18
|
}
|
|
19
19
|
export async function useCssInline() {
|
|
20
|
-
cssInlineInstance.instance = cssInlineInstance.instance || await import("#
|
|
20
|
+
cssInlineInstance.instance = cssInlineInstance.instance || await import("#og-image/bindings/css-inline").then((m) => m.default);
|
|
21
21
|
await cssInlineInstance.instance.initWasmPromise;
|
|
22
22
|
return cssInlineInstance.instance.cssInline;
|
|
23
23
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { theme } from "#
|
|
1
|
+
import { theme } from "#og-image-virtual/unocss-config.mjs";
|
|
2
2
|
import { createGenerator } from "@unocss/core";
|
|
3
3
|
import presetWind from "@unocss/preset-wind";
|
|
4
4
|
import { defineSatoriTransformer } from "../utils.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { fontCache } from "#og-image-cache";
|
|
2
|
+
import { theme } from "#og-image-virtual/unocss-config.mjs";
|
|
3
3
|
import { defu } from "defu";
|
|
4
4
|
import { normaliseFontInput, useOgImageRuntimeConfig } from "../../../shared.js";
|
|
5
5
|
import { loadFont } from "./font.js";
|
|
@@ -11,19 +11,21 @@ async function resolveFonts(event) {
|
|
|
11
11
|
const normalisedFonts = normaliseFontInput([...event.options.fonts || [], ...fonts]);
|
|
12
12
|
const localFontPromises = [];
|
|
13
13
|
const preloadedFonts = [];
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
fontPromises[font.cacheKey]
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
if (fontCache) {
|
|
15
|
+
for (const font of normalisedFonts) {
|
|
16
|
+
if (await fontCache.hasItem(font.cacheKey)) {
|
|
17
|
+
font.data = await fontCache.getItemRaw(font.cacheKey);
|
|
18
|
+
preloadedFonts.push(font);
|
|
19
|
+
} else {
|
|
20
|
+
if (!fontPromises[font.cacheKey]) {
|
|
21
|
+
fontPromises[font.cacheKey] = loadFont(event, font).then(async (_font) => {
|
|
22
|
+
if (_font?.data)
|
|
23
|
+
await fontCache?.setItemRaw(_font.cacheKey, _font.data);
|
|
24
|
+
return _font;
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
localFontPromises.push(fontPromises[font.cacheKey]);
|
|
25
28
|
}
|
|
26
|
-
localFontPromises.push(fontPromises[font.cacheKey]);
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
const awaitedFonts = await Promise.all(localFontPromises);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineNitroPlugin } from "
|
|
1
|
+
import { defineNitroPlugin } from "#imports";
|
|
2
2
|
import { nuxtContentPlugin } from "../../util/plugins.js";
|
|
3
3
|
export default defineNitroPlugin((nitroApp) => {
|
|
4
4
|
if (import.meta.dev || import.meta.prerender) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { defineNitroPlugin } from "#imports";
|
|
2
|
+
import { prerenderOptionsCache } from "#og-image-cache";
|
|
3
3
|
import { parseURL } from "ufo";
|
|
4
4
|
import { isInternalRoute } from "../../pure.js";
|
|
5
5
|
import { extractAndNormaliseOgImageOptions, resolvePathCacheKey } from "../og-image/context.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import compatibility from "#
|
|
2
|
-
import { componentNames } from "#
|
|
1
|
+
import compatibility from "#og-image/compatibility";
|
|
2
|
+
import { componentNames } from "#og-image-virtual/component-names.mjs";
|
|
3
3
|
import { defineEventHandler, setHeader } from "h3";
|
|
4
4
|
import { useOgImageRuntimeConfig } from "../../shared.js";
|
|
5
5
|
export default defineEventHandler(async (e) => {
|
|
@@ -3,15 +3,19 @@ import { stringify } from "devalue";
|
|
|
3
3
|
import { getOgImagePath, useOgImageRuntimeConfig } from "../../shared.js";
|
|
4
4
|
import { normaliseOptions } from "./options.js";
|
|
5
5
|
export function nuxtContentPlugin(nitroApp) {
|
|
6
|
-
const { isNuxtContentDocumentDriven, defaults } = useOgImageRuntimeConfig();
|
|
6
|
+
const { isNuxtContentDocumentDriven, strictNuxtContentPaths, defaults } = useOgImageRuntimeConfig();
|
|
7
7
|
nitroApp.hooks.hook("content:file:afterParse", async (content) => {
|
|
8
8
|
if (content._draft || content._extension !== "md" || content._partial || content.indexable === false || content.index === false)
|
|
9
9
|
return;
|
|
10
10
|
let path = content.path;
|
|
11
|
-
if (isNuxtContentDocumentDriven &&
|
|
11
|
+
if (isNuxtContentDocumentDriven && !path)
|
|
12
12
|
path = content._path;
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
let shouldRenderOgImage = !!content.ogImage;
|
|
14
|
+
if (typeof content.ogImage === "undefined" && (strictNuxtContentPaths || typeof content.path !== "undefined")) {
|
|
15
|
+
shouldRenderOgImage = true;
|
|
16
|
+
}
|
|
17
|
+
if (path && shouldRenderOgImage) {
|
|
18
|
+
const ogImageConfig = (typeof content.ogImage === "object" ? content.ogImage : {}) || {};
|
|
15
19
|
const optionsWithDefault = defu(ogImageConfig, defaults);
|
|
16
20
|
const src = getOgImagePath(path, optionsWithDefault);
|
|
17
21
|
const payload = {
|
package/dist/runtime/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { OgImageComponents } from '#
|
|
1
|
+
import type { OgImageComponents } from '#og-image/components';
|
|
2
2
|
import type { ResvgRenderOptions } from '@resvg/resvg-js';
|
|
3
3
|
import type { AllowedComponentProps, Component, ComponentCustomProps, VNodeProps } from '@vue/runtime-core';
|
|
4
4
|
import type { H3Error, H3Event } from 'h3';
|
|
@@ -30,7 +30,9 @@ export interface OgImageRuntimeConfig {
|
|
|
30
30
|
fonts: FontConfig[];
|
|
31
31
|
hasNuxtIcon: boolean;
|
|
32
32
|
colorPreference: 'light' | 'dark';
|
|
33
|
+
hasNuxtContent: boolean;
|
|
33
34
|
isNuxtContentDocumentDriven: boolean;
|
|
35
|
+
strictNuxtContentPaths: boolean;
|
|
34
36
|
zeroRuntime: boolean;
|
|
35
37
|
}
|
|
36
38
|
export interface OgImageComponent {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-og-image",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.9",
|
|
5
5
|
"description": "Enlightened OG Image generation for Nuxt.",
|
|
6
6
|
"author": {
|
|
7
7
|
"website": "https://harlanzw.com",
|
|
@@ -35,85 +35,88 @@
|
|
|
35
35
|
"node": ">=18.0.0"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@nuxt/devtools-kit": "^1.6.
|
|
39
|
-
"@nuxt/kit": "^3.
|
|
38
|
+
"@nuxt/devtools-kit": "^1.6.1",
|
|
39
|
+
"@nuxt/kit": "^3.14.1592",
|
|
40
40
|
"@resvg/resvg-js": "^2.6.2",
|
|
41
41
|
"@resvg/resvg-wasm": "^2.6.2",
|
|
42
|
-
"@unocss/core": "^0.
|
|
43
|
-
"@unocss/preset-wind": "^0.
|
|
42
|
+
"@unocss/core": "^0.64.1",
|
|
43
|
+
"@unocss/preset-wind": "^0.64.1",
|
|
44
44
|
"chrome-launcher": "^1.1.2",
|
|
45
45
|
"defu": "^6.1.4",
|
|
46
46
|
"execa": "^9.5.1",
|
|
47
47
|
"image-size": "^1.1.1",
|
|
48
|
-
"magic-string": "^0.30.
|
|
49
|
-
"nuxt-site-config": "^2.2.
|
|
50
|
-
"nuxt-site-config-kit": "^2.2.
|
|
48
|
+
"magic-string": "^0.30.13",
|
|
49
|
+
"nuxt-site-config": "^2.2.21",
|
|
50
|
+
"nuxt-site-config-kit": "^2.2.21",
|
|
51
51
|
"nypm": "^0.3.12",
|
|
52
52
|
"ofetch": "^1.4.1",
|
|
53
53
|
"ohash": "^1.1.4",
|
|
54
54
|
"pathe": "^1.1.2",
|
|
55
55
|
"pkg-types": "^1.2.1",
|
|
56
|
-
"playwright-core": "^1.
|
|
56
|
+
"playwright-core": "^1.49.0",
|
|
57
57
|
"radix3": "^1.1.2",
|
|
58
|
-
"satori": "^0.
|
|
58
|
+
"satori": "^0.12.0",
|
|
59
59
|
"satori-html": "^0.3.2",
|
|
60
60
|
"sirv": "^3.0.0",
|
|
61
|
-
"std-env": "^3.
|
|
61
|
+
"std-env": "^3.8.0",
|
|
62
62
|
"strip-literal": "^2.1.0",
|
|
63
63
|
"ufo": "^1.5.4",
|
|
64
|
-
"unplugin": "^1.
|
|
64
|
+
"unplugin": "^1.16.0",
|
|
65
65
|
"unwasm": "^0.3.9",
|
|
66
66
|
"yoga-wasm-web": "^0.3.3"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@antfu/eslint-config": "^3.
|
|
70
|
-
"@css-inline/css-inline": "^0.14.
|
|
69
|
+
"@antfu/eslint-config": "^3.9.2",
|
|
70
|
+
"@css-inline/css-inline": "^0.14.3",
|
|
71
71
|
"@headlessui/vue": "^1.7.23",
|
|
72
72
|
"@iconify-json/carbon": "^1.2.4",
|
|
73
73
|
"@iconify-json/logos": "^1.2.3",
|
|
74
74
|
"@iconify-json/noto": "^1.2.1",
|
|
75
|
-
"@iconify-json/ri": "^1.2.
|
|
76
|
-
"@iconify-json/tabler": "^1.2.
|
|
75
|
+
"@iconify-json/ri": "^1.2.3",
|
|
76
|
+
"@iconify-json/tabler": "^1.2.8",
|
|
77
77
|
"@img/sharp-linux-x64": "0.33.5",
|
|
78
78
|
"@nuxt/content": "^2.13.4",
|
|
79
|
-
"@nuxt/devtools": "1.6.
|
|
80
|
-
"@nuxt/devtools-ui-kit": "^1.6.
|
|
81
|
-
"@nuxt/icon": "^1.
|
|
79
|
+
"@nuxt/devtools": "1.6.1",
|
|
80
|
+
"@nuxt/devtools-ui-kit": "^1.6.1",
|
|
81
|
+
"@nuxt/icon": "^1.8.2",
|
|
82
82
|
"@nuxt/image": "^1.8.1",
|
|
83
83
|
"@nuxt/module-builder": "^0.8.4",
|
|
84
84
|
"@nuxt/test-utils": "3.14.4",
|
|
85
|
-
"@nuxt/ui": "^2.
|
|
85
|
+
"@nuxt/ui": "^2.19.2",
|
|
86
86
|
"@nuxtjs/color-mode": "^3.5.2",
|
|
87
87
|
"@nuxtjs/eslint-config-typescript": "^12.1.0",
|
|
88
|
-
"@nuxtjs/i18n": "^
|
|
88
|
+
"@nuxtjs/i18n": "^9.1.0",
|
|
89
89
|
"@nuxtjs/tailwindcss": "^6.12.2",
|
|
90
|
-
"@unocss/nuxt": "^0.
|
|
91
|
-
"@unocss/preset-icons": "^0.
|
|
92
|
-
"@unocss/preset-uno": "^0.
|
|
93
|
-
"@unocss/runtime": "^0.
|
|
94
|
-
"@vueuse/nuxt": "^11.
|
|
95
|
-
"bumpp": "^9.8.
|
|
96
|
-
"eslint": "9.
|
|
90
|
+
"@unocss/nuxt": "^0.64.1",
|
|
91
|
+
"@unocss/preset-icons": "^0.64.1",
|
|
92
|
+
"@unocss/preset-uno": "^0.64.1",
|
|
93
|
+
"@unocss/runtime": "^0.64.1",
|
|
94
|
+
"@vueuse/nuxt": "^11.3.0",
|
|
95
|
+
"bumpp": "^9.8.1",
|
|
96
|
+
"eslint": "9.15.0",
|
|
97
97
|
"jest-image-snapshot": "^6.4.0",
|
|
98
|
-
"nuxt": "^3.
|
|
99
|
-
"playwright": "^1.
|
|
100
|
-
"sass": "^1.
|
|
98
|
+
"nuxt": "^3.14.1592",
|
|
99
|
+
"playwright": "^1.49.0",
|
|
100
|
+
"sass": "^1.81.0",
|
|
101
101
|
"sharp": "^0.33.5",
|
|
102
|
-
"typescript": "
|
|
103
|
-
"unocss": "^0.
|
|
104
|
-
"vitest": "^2.1.
|
|
102
|
+
"typescript": "5.6.3",
|
|
103
|
+
"unocss": "^0.64.1",
|
|
104
|
+
"vitest": "^2.1.5"
|
|
105
105
|
},
|
|
106
106
|
"resolutions": {
|
|
107
|
-
"@vue/server-renderer": "3.5.
|
|
108
|
-
"vue": "3.5.
|
|
109
|
-
"vue-router": "4.4.
|
|
107
|
+
"@vue/server-renderer": "3.5.13",
|
|
108
|
+
"vue": "3.5.13",
|
|
109
|
+
"vue-router": "4.4.5"
|
|
110
110
|
},
|
|
111
111
|
"build": {
|
|
112
112
|
"externals": [
|
|
113
|
+
"nuxt",
|
|
114
|
+
"#app",
|
|
115
|
+
"nuxt/app",
|
|
113
116
|
"h3",
|
|
114
117
|
"nitropack",
|
|
115
118
|
"@vue/runtime-core",
|
|
116
|
-
"#
|
|
119
|
+
"#og-image/components",
|
|
117
120
|
"sharp",
|
|
118
121
|
"unstorage",
|
|
119
122
|
"unstorage/drivers/fs",
|