nuxt-og-image 3.0.0-rc.5 → 3.0.0-rc.50
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/README.md +5 -10
- package/dist/client/200.html +238 -15
- package/dist/client/404.html +238 -15
- package/dist/client/_nuxt/-7WWnkdy.js +517 -0
- package/dist/client/_nuxt/1Je9_Reo.js +136 -0
- package/dist/client/_nuxt/1PhbusK7.js +1 -0
- package/dist/client/_nuxt/37ic6j3l.js +1 -0
- package/dist/client/_nuxt/3ghuYFLd.js +1 -0
- package/dist/client/_nuxt/6Kuza3Wr.js +1 -0
- package/dist/client/_nuxt/6XBPEST2.js +1 -0
- package/dist/client/_nuxt/7fd6vGzb.js +1 -0
- package/dist/client/_nuxt/8t4jSAMm.js +1 -0
- package/dist/client/_nuxt/9B1nZgL-.js +1 -0
- package/dist/client/_nuxt/9ZOzOPqN.js +1 -0
- package/dist/client/_nuxt/A1WiD9SJ.js +1 -0
- package/dist/client/_nuxt/AgnqFTPX.js +13 -0
- package/dist/client/_nuxt/B1nm99XP.js +2 -0
- package/dist/client/_nuxt/B1oDq3oi.js +135 -0
- package/dist/client/_nuxt/B2BuIiKK.js +1 -0
- package/dist/client/_nuxt/B2DkETJQ.js +1 -0
- package/dist/client/_nuxt/B4yE-MfL.js +38 -0
- package/dist/client/_nuxt/B6nY7VDA.js +25 -0
- package/dist/client/_nuxt/B9CT-1u6.js +7 -0
- package/dist/client/_nuxt/B9E_xdxs.js +666 -0
- package/dist/client/_nuxt/B9S9BZZh.js +1 -0
- package/dist/client/_nuxt/BBDuFDsq.js +1 -0
- package/dist/client/_nuxt/BBJYjQ0k.js +1 -0
- package/dist/client/_nuxt/BBv1LFm6.js +6 -0
- package/dist/client/_nuxt/BF6G6X0H.js +1 -0
- package/dist/client/_nuxt/BG_OyJVq.js +1 -0
- package/dist/client/_nuxt/BH1M7C1g.js +1 -0
- package/dist/client/_nuxt/BH_RS3WO.js +1 -0
- package/dist/client/_nuxt/BICIrM8O.js +1 -0
- package/dist/client/_nuxt/BILqrcpa.js +1 -0
- package/dist/client/_nuxt/BIMuYTWL.js +3 -0
- package/dist/client/_nuxt/BITGhEdf.js +1 -0
- package/dist/client/_nuxt/BIxS-Weu.js +1 -0
- package/dist/client/_nuxt/BLluXI4E.js +1 -0
- package/dist/client/_nuxt/BN4LRXf6.js +4 -0
- package/dist/client/_nuxt/BOnd8D4O.js +186 -0
- package/dist/client/_nuxt/BOpLLL-w.js +1 -0
- package/dist/client/_nuxt/BPiaQZfK.js +1 -0
- package/dist/client/_nuxt/BR6CMsBL.js +1 -0
- package/dist/client/_nuxt/BSB_bK09.js +1 -0
- package/dist/client/_nuxt/BSyl5yf0.js +1 -0
- package/dist/client/_nuxt/BT9ZzGyQ.js +69 -0
- package/dist/client/_nuxt/BTtaZsq5.js +1 -0
- package/dist/client/_nuxt/BUpeXbsf.js +25 -0
- package/dist/client/_nuxt/BWKJ1FCf.js +239 -0
- package/dist/client/_nuxt/BXF7Vm5l.js +1 -0
- package/dist/client/_nuxt/BXfENWL6.js +1 -0
- package/dist/client/_nuxt/BZz1Hhek.js +1 -0
- package/dist/client/_nuxt/B_SUYfiV.js +1 -0
- package/dist/client/_nuxt/BaNxgKSR.js +17 -0
- package/dist/client/_nuxt/BaWyeHV_.js +1 -0
- package/dist/client/_nuxt/BaedD2tq.js +1 -0
- package/dist/client/_nuxt/BbJj1K1w.js +1 -0
- package/dist/client/_nuxt/Bbv8ARUV.js +13 -0
- package/dist/client/_nuxt/Bd7iooY8.js +8 -0
- package/dist/client/_nuxt/Bdb36Id5.js +1 -0
- package/dist/client/_nuxt/BeX7Iu5M.js +90 -0
- package/dist/client/_nuxt/BeocmOPF.js +1 -0
- package/dist/client/_nuxt/Bg0wAK5a.js +100 -0
- package/dist/client/_nuxt/BgBwMnrY.js +76 -0
- package/dist/client/_nuxt/Bgpqy2XC.js +1 -0
- package/dist/client/_nuxt/Bh8mriwU.js +17 -0
- package/dist/client/_nuxt/BiDE021q.js +1 -0
- package/dist/client/_nuxt/Bj5xdiaE.js +1 -0
- package/dist/client/_nuxt/BlxWTfDV.js +699 -0
- package/dist/client/_nuxt/BmCW-tYz.js +86 -0
- package/dist/client/_nuxt/Bn5gmY5k.js +1 -0
- package/dist/client/_nuxt/BrGg7AAd.js +1 -0
- package/dist/client/_nuxt/BsfQk1vf.js +1 -0
- package/dist/client/_nuxt/Bsp1M94H.js +1 -0
- package/dist/client/_nuxt/BsvsQ1iS.js +1 -0
- package/dist/client/_nuxt/BswfO-CF.js +1 -0
- package/dist/client/_nuxt/Btshr8M_.js +70 -0
- package/dist/client/_nuxt/BxwAa5i0.js +1 -0
- package/dist/client/_nuxt/ByMv4Xf1.js +1 -0
- package/dist/client/_nuxt/Bz4xi2rU.js +1 -0
- package/dist/client/_nuxt/C15OxdQ5.js +1 -0
- package/dist/client/_nuxt/C1DVX8_8.js +831 -0
- package/dist/client/_nuxt/C2TBxDwV.js +1 -0
- package/dist/client/_nuxt/C3YqBJkQ.js +1 -0
- package/dist/client/_nuxt/C5gCGmDW.js +200 -0
- package/dist/client/_nuxt/C6Aznpr-.js +1 -0
- package/dist/client/_nuxt/C7oZ9nno.js +1 -0
- package/dist/client/_nuxt/C86elO-m.js +1 -0
- package/dist/client/_nuxt/C9d3aiqh.js +1 -0
- package/dist/client/_nuxt/CApMHEaB.js +1 -0
- package/dist/client/_nuxt/CBL0qBdF.js +1 -0
- package/dist/client/_nuxt/CBPJd_fO.js +1 -0
- package/dist/client/_nuxt/CG4fK2Nq.js +21 -0
- package/dist/client/_nuxt/CGQbO34C.js +1 -0
- package/dist/client/_nuxt/CIekO_uJ.js +1 -0
- package/dist/client/_nuxt/CJQrLysU.js +1 -0
- package/dist/client/_nuxt/CL7Ixq1B.js +1 -0
- package/dist/client/_nuxt/CMDmr8et.js +2 -0
- package/dist/client/_nuxt/CPHkTjfH.js +1 -0
- package/dist/client/_nuxt/CQTpvb7m.js +1 -0
- package/dist/client/_nuxt/CQUCfALx.js +13 -0
- package/dist/client/_nuxt/CRDKj6ck.js +1 -0
- package/dist/client/_nuxt/CRWwmX0L.js +1 -0
- package/dist/client/_nuxt/CRlnGVMD.js +1 -0
- package/dist/client/_nuxt/CThH5sBG.js +1 -0
- package/dist/client/_nuxt/CUVblut_.js +1 -0
- package/dist/client/_nuxt/CX_FIdg1.js +1 -0
- package/dist/client/_nuxt/CZZ6oYdA.js +1 -0
- package/dist/client/_nuxt/C_8Fx7bH.js +1 -0
- package/dist/client/_nuxt/CbViG2Xw.js +74 -0
- package/dist/client/_nuxt/CbYhyuC0.js +505 -0
- package/dist/client/_nuxt/Cda-MJFk.js +1 -0
- package/dist/client/_nuxt/CdedUr_-.js +1 -0
- package/dist/client/_nuxt/CfPQhs6g.js +7 -0
- package/dist/client/_nuxt/Cicx_DS6.js +1 -0
- package/dist/client/_nuxt/ClXEvkw9.js +68 -0
- package/dist/client/_nuxt/CoEqzGFw.js +44 -0
- package/dist/client/_nuxt/CowR2XfX.js +1 -0
- package/dist/client/_nuxt/CrhH3_Og.js +1 -0
- package/dist/client/_nuxt/CrjQeCwm.js +1 -0
- package/dist/client/_nuxt/CsTmP73Z.js +1 -0
- package/dist/client/_nuxt/CsYA0RN7.js +1 -0
- package/dist/client/_nuxt/CsyjKwr8.js +1 -0
- package/dist/client/_nuxt/CsyrCbsw.js +699 -0
- package/dist/client/_nuxt/Cthz8VOO.js +771 -0
- package/dist/client/_nuxt/CupVZNk8.js +25 -0
- package/dist/client/_nuxt/CxrokwfH.js +1 -0
- package/dist/client/_nuxt/CzPA46E-.js +1 -0
- package/dist/client/_nuxt/D-pQtGOP.js +1 -0
- package/dist/client/_nuxt/D384ylkT.js +1 -0
- package/dist/client/_nuxt/D3VXSfF0.js +1 -0
- package/dist/client/_nuxt/D4LaosRr.js +1 -0
- package/dist/client/_nuxt/D4LhxNOI.js +1 -0
- package/dist/client/_nuxt/D4k753MY.js +1 -0
- package/dist/client/_nuxt/D6NljDpC.js +1 -0
- package/dist/client/_nuxt/D6pmzCqS.js +1 -0
- package/dist/client/_nuxt/D7gg1Usp.js +1 -0
- package/dist/client/_nuxt/DAGYewaG.js +559 -0
- package/dist/client/_nuxt/DAVo6uMX.js +1 -0
- package/dist/client/_nuxt/DBxHOdLe.js +1 -0
- package/dist/client/_nuxt/DC4hdoM9.js +87 -0
- package/dist/client/_nuxt/DC8MraHL.js +666 -0
- package/dist/client/_nuxt/DCAtC51B.js +80 -0
- package/dist/client/_nuxt/DCdPDLy4.js +40 -0
- package/dist/client/_nuxt/DCj4DH6i.js +1 -0
- package/dist/client/_nuxt/DCk2z-Tu.js +129 -0
- package/dist/client/_nuxt/DDRuGeQH.js +1 -0
- package/dist/client/_nuxt/DE2vi0a_.js +1 -0
- package/dist/client/_nuxt/DFF-wSSt.js +8 -0
- package/dist/client/_nuxt/DGO8GyiP.js +1 -0
- package/dist/client/_nuxt/DHmGyzbM.js +109 -0
- package/dist/client/_nuxt/DISxKEhY.js +756 -0
- package/dist/client/_nuxt/DIr-ordK.js +1 -0
- package/dist/client/_nuxt/DJZWsvj0.js +1 -0
- package/dist/client/_nuxt/DLP9ZvWb.js +3 -0
- package/dist/client/_nuxt/DNR26wTC.js +1 -0
- package/dist/client/_nuxt/DOtRmeXT.js +1 -0
- package/dist/client/_nuxt/DSrLtGYv.js +15 -0
- package/dist/client/_nuxt/DSsji4Hu.js +1 -0
- package/dist/client/_nuxt/DUdlC5k_.js +1 -0
- package/dist/client/_nuxt/DVfdqzEq.js +1 -0
- package/dist/client/_nuxt/DXFkqnOI.js +816 -0
- package/dist/client/_nuxt/DXT9h7v2.js +1 -0
- package/dist/client/_nuxt/DXZpi2gR.js +1 -0
- package/dist/client/_nuxt/DXpYegZJ.js +1 -0
- package/dist/client/_nuxt/DY7_9Ga-.js +1 -0
- package/dist/client/_nuxt/DYI1rfmx.js +25 -0
- package/dist/client/_nuxt/DZ3fVoEH.js +1 -0
- package/dist/client/_nuxt/DZqG9GXz.js +50 -0
- package/dist/client/_nuxt/DbK06e1c.js +21 -0
- package/dist/client/_nuxt/Dble9ECP.js +1 -0
- package/dist/client/_nuxt/Dch3xQiY.js +699 -0
- package/dist/client/_nuxt/DdacRhvC.js +1 -0
- package/dist/client/_nuxt/DeVv6D4_.js +1 -0
- package/dist/client/_nuxt/Dez-Qvcc.js +544 -0
- package/dist/client/_nuxt/DfUNg_8t.js +1 -0
- package/dist/client/_nuxt/DfeQjIbs.js +5 -0
- package/dist/client/_nuxt/Dg0DGYq4.js +14 -0
- package/dist/client/_nuxt/DggdVF2v.js +1 -0
- package/dist/client/_nuxt/DhFF74a2.js +1 -0
- package/dist/client/_nuxt/DjTlIhuc.js +1 -0
- package/dist/client/_nuxt/DmDrTTlz.js +1 -0
- package/dist/client/_nuxt/DnLUQrgA.js +1 -0
- package/dist/client/_nuxt/DnhXxWz-.js +1 -0
- package/dist/client/_nuxt/DouzTJIq.js +1 -0
- package/dist/client/_nuxt/DsfXcHUZ.js +29 -0
- package/dist/client/_nuxt/DsudziMp.js +16 -0
- package/dist/client/_nuxt/Dszwcx0o.js +1 -0
- package/dist/client/_nuxt/DvyTQcux.js +1 -0
- package/dist/client/_nuxt/Dwo2i-71.js +1 -0
- package/dist/client/_nuxt/DwuVtWc2.js +518 -0
- package/dist/client/_nuxt/DywwDckn.js +159 -0
- package/dist/client/_nuxt/Dz2Ca8U2.js +1 -0
- package/dist/client/_nuxt/DzPyIVdT.js +9 -0
- package/dist/client/_nuxt/DzwdaLuO.js +223 -0
- package/dist/client/_nuxt/Eh5U-gDp.js +52 -0
- package/dist/client/_nuxt/GYW2pyXg.js +1 -0
- package/dist/client/_nuxt/I4qd5QHW.js +10 -0
- package/dist/client/_nuxt/IHMnEr_d.js +1 -0
- package/dist/client/_nuxt/IconCSS.R7ZScADi.css +1 -0
- package/dist/client/_nuxt/KEYLhlmT.js +1 -0
- package/dist/client/_nuxt/NL97_oaV.js +1 -0
- package/dist/client/_nuxt/PWN5J14X.js +1 -0
- package/dist/client/_nuxt/PifQWv0n.js +1 -0
- package/dist/client/_nuxt/QZ3jNtnE.js +515 -0
- package/dist/client/_nuxt/RCJZWN-0.js +81 -0
- package/dist/client/_nuxt/RE3ujT-k.js +1 -0
- package/dist/client/_nuxt/RgJsN3zu.js +1 -0
- package/dist/client/_nuxt/RqY_Nz63.js +1 -0
- package/dist/client/_nuxt/Sfo2eW0G.js +274 -0
- package/dist/client/_nuxt/T9ysyp6P.js +62 -0
- package/dist/client/_nuxt/TQ9oWRfF.js +1 -0
- package/dist/client/_nuxt/UREJT2Bw.js +1 -0
- package/dist/client/_nuxt/Urb1RsFe.js +1 -0
- package/dist/client/_nuxt/WoBtJUue.js +1 -0
- package/dist/client/_nuxt/YxQm0tCS.js +1 -0
- package/dist/client/_nuxt/ZQC2c-5V.js +9 -0
- package/dist/client/_nuxt/beD-FUib.js +1 -0
- package/dist/client/_nuxt/bmJ2objS.js +1 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/00641375-8e8c-44ba-9041-bba25cf56aef.json +1 -0
- package/dist/client/_nuxt/doGI2cFk.js +1 -0
- package/dist/client/_nuxt/eJfcURhx.js +1 -0
- package/dist/client/_nuxt/entry.DSfe2lIv.css +1 -0
- package/dist/client/_nuxt/error-404.ORekjfyJ.css +1 -0
- package/dist/client/_nuxt/hXH8Gyq8.js +1 -0
- package/dist/client/_nuxt/i0IPvypD.js +1 -0
- package/dist/client/_nuxt/iSbrOpM4.js +1 -0
- package/dist/client/_nuxt/j8KhMG0x.js +1 -0
- package/dist/client/_nuxt/jaXbsbtS.js +1 -0
- package/dist/client/_nuxt/nclm9rTJ.js +266 -0
- package/dist/client/_nuxt/o-cPXEvd.js +575 -0
- package/dist/client/_nuxt/rS0jd3Ly.js +1 -0
- package/dist/client/_nuxt/sMI-pExk.js +1 -0
- package/dist/client/_nuxt/sQpxpyUs.js +1 -0
- package/dist/client/_nuxt/vMsNTMhM.js +5 -0
- package/dist/client/_nuxt/wChcbJ1V.js +37 -0
- package/dist/client/_nuxt/wORFcijT.js +32 -0
- package/dist/client/_nuxt/wPLeKH6q.js +40 -0
- package/dist/client/_nuxt/xPNGhBYe.js +1 -0
- package/dist/client/index.html +238 -15
- package/dist/module.d.mts +13 -5
- package/dist/module.d.ts +13 -5
- package/dist/module.json +2 -2
- package/dist/module.mjs +195 -128
- package/dist/runtime/assets/Inter-400.ttf.base64 +1 -0
- package/dist/runtime/assets/Inter-700.ttf.base64 +1 -0
- package/dist/runtime/nitro/og-image/bindings/chromium/chrome-launcher.mjs +9 -0
- package/dist/runtime/nitro/og-image/bindings/chromium/on-demand.d.ts +2 -0
- package/dist/runtime/nitro/og-image/bindings/chromium/on-demand.mjs +36 -0
- package/dist/runtime/nitro/og-image/bindings/chromium/playwright.d.ts +2 -0
- package/dist/runtime/nitro/og-image/bindings/chromium/playwright.mjs +6 -0
- package/dist/runtime/nitro/og-image/bindings/css-inline/node.d.ts +8 -0
- package/dist/runtime/nitro/og-image/bindings/css-inline/node.mjs +7 -0
- package/dist/runtime/nitro/og-image/bindings/css-inline/wasm-fs.d.ts +8 -0
- package/dist/runtime/nitro/og-image/bindings/css-inline/wasm-fs.mjs +8 -0
- package/dist/runtime/nitro/og-image/bindings/css-inline/wasm.d.ts +8 -0
- package/dist/runtime/nitro/og-image/bindings/css-inline/wasm.mjs +7 -0
- package/dist/runtime/{core → nitro/og-image}/bindings/resvg/wasm-fs.mjs +1 -1
- package/dist/runtime/nitro/og-image/bindings/resvg/wasm.mjs +5 -0
- package/dist/runtime/{core → nitro/og-image}/bindings/satori/wasm-fs.mjs +1 -1
- package/dist/runtime/{core → nitro/og-image}/bindings/satori/wasm.mjs +1 -2
- package/dist/runtime/nitro/og-image/cache.d.ts +7 -0
- package/dist/runtime/{core/cache/htmlPayload.mjs → nitro/og-image/cache.mjs} +4 -1
- package/dist/runtime/{core/renderers → nitro/og-image}/chromium/screenshot.mjs +1 -1
- package/dist/runtime/nitro/og-image/context.d.ts +5 -0
- package/dist/runtime/nitro/og-image/context.mjs +177 -0
- package/dist/runtime/nitro/og-image/instances.d.ts +2 -0
- package/dist/runtime/nitro/og-image/instances.mjs +10 -0
- package/dist/runtime/{core/font/fetch.d.ts → nitro/og-image/satori/font.d.ts} +1 -1
- package/dist/runtime/nitro/og-image/satori/font.mjs +33 -0
- package/dist/runtime/{core/renderers → nitro/og-image}/satori/instances.d.ts +0 -2
- package/dist/runtime/{core/renderers → nitro/og-image}/satori/instances.mjs +2 -11
- package/dist/runtime/nitro/og-image/satori/plugins/classes.mjs +17 -0
- package/dist/runtime/nitro/og-image/satori/plugins/encoding.mjs +17 -0
- package/dist/runtime/nitro/og-image/satori/plugins/imageSrc.mjs +82 -0
- package/dist/runtime/{core/renderers/satori/index.mjs → nitro/og-image/satori/renderer.mjs} +28 -15
- package/dist/runtime/{core/html/applyEmojis.d.ts → nitro/og-image/satori/transforms/emojis.d.ts} +3 -1
- package/dist/runtime/nitro/og-image/satori/transforms/emojis.mjs +3597 -0
- package/dist/runtime/{core/html/applyInlineCss.d.ts → nitro/og-image/satori/transforms/inlineCss.d.ts} +1 -1
- package/dist/runtime/nitro/og-image/satori/transforms/inlineCss.mjs +41 -0
- package/dist/runtime/{core/renderers → nitro/og-image}/satori/vnodes.mjs +9 -7
- package/dist/runtime/nitro/og-image/templates/html.d.ts +2 -0
- package/dist/runtime/{core/html/devIframeTemplate.mjs → nitro/og-image/templates/html.mjs} +17 -9
- package/dist/runtime/nitro/plugins/nuxt-content.mjs +7 -4
- package/dist/runtime/nitro/plugins/prerender.d.ts +1 -1
- package/dist/runtime/nitro/plugins/prerender.mjs +8 -16
- package/dist/runtime/{server/routes/__og-image__ → nitro/routes}/debug.json.d.ts +1 -1
- package/dist/runtime/{server/routes/__og-image__ → nitro/routes}/debug.json.mjs +1 -1
- package/dist/runtime/{server/routes/__og-image__/font-[name]-[weight].[extension].mjs → nitro/routes/font.mjs} +18 -1
- package/dist/runtime/{server/routes/__og-image__ → nitro/routes}/image.mjs +9 -10
- package/dist/runtime/nitro/tsconfig.json +3 -0
- package/dist/runtime/{cache.d.ts → nitro/util/cache.d.ts} +1 -1
- package/dist/runtime/nitro/util/encoding.d.ts +3 -0
- package/dist/runtime/nitro/util/encoding.mjs +15 -0
- package/dist/runtime/nitro/util/kit.d.ts +6 -0
- package/dist/runtime/nitro/util/kit.mjs +32 -0
- package/dist/runtime/{components → nuxt/components}/OgImage/OgImage.d.ts +2 -2
- package/dist/runtime/{components → nuxt/components}/OgImage/OgImageScreenshot.d.ts +2 -2
- package/dist/runtime/nuxt/components/Templates/Community/Frame.vue +64 -0
- package/dist/runtime/{components → nuxt/components}/Templates/Community/NuxtSeo.vue +1 -1
- package/dist/runtime/{components → nuxt/components}/Templates/Community/UnJs.vue +2 -2
- package/dist/runtime/{composables → nuxt/composables}/defineOgImage.d.ts +1 -1
- package/dist/runtime/{composables → nuxt/composables}/defineOgImage.mjs +6 -11
- package/dist/runtime/{composables → nuxt/composables}/defineOgImageComponent.d.ts +1 -1
- package/dist/runtime/{composables → nuxt/composables}/defineOgImageScreenshot.d.ts +1 -1
- package/dist/runtime/nuxt/composables/mock.d.ts +0 -0
- package/dist/runtime/nuxt/composables/mock.mjs +6 -0
- package/dist/runtime/nuxt/plugins/og-image-canonical-urls.server.mjs +14 -5
- package/dist/runtime/nuxt/plugins/route-rule-og-image.server.mjs +1 -1
- package/dist/runtime/nuxt/utils.d.ts +2 -1
- package/dist/runtime/nuxt/utils.mjs +1 -1
- package/dist/runtime/{utils.pure.d.ts → pure.d.ts} +1 -0
- package/dist/runtime/{utils.pure.mjs → pure.mjs} +12 -3
- package/dist/runtime/{utils.d.ts → shared.d.ts} +1 -1
- package/dist/runtime/{utils.mjs → shared.mjs} +3 -2
- package/dist/runtime/types.d.ts +12 -5
- package/dist/types.d.mts +2 -2
- package/package.json +78 -53
- package/dist/client/_nuxt/IconCSS.b7e5876d.js +0 -1
- package/dist/client/_nuxt/IconCSS.f0b56d3e.css +0 -1
- package/dist/client/_nuxt/builds/meta/4b44e059-802c-46c9-90d2-f73641cbd674.json +0 -1
- package/dist/client/_nuxt/entry.006451f1.js +0 -108
- package/dist/client/_nuxt/entry.a30f63d0.css +0 -1
- package/dist/client/_nuxt/error-404.b751fa02.css +0 -1
- package/dist/client/_nuxt/error-404.d6ff1eb0.js +0 -1
- package/dist/client/_nuxt/error-500.3acec475.js +0 -1
- package/dist/client/_nuxt/vanilla-picker-NKbIFE8h.23409a58.js +0 -8
- package/dist/runtime/core/bindings/chromium/node.mjs +0 -33
- package/dist/runtime/core/bindings/css-inline/node.d.ts +0 -2
- package/dist/runtime/core/bindings/css-inline/node.mjs +0 -2
- package/dist/runtime/core/bindings/resvg/wasm.mjs +0 -6
- package/dist/runtime/core/cache/emojis.d.ts +0 -1
- package/dist/runtime/core/cache/emojis.mjs +0 -5
- package/dist/runtime/core/cache/fonts.d.ts +0 -3
- package/dist/runtime/core/cache/fonts.mjs +0 -6
- package/dist/runtime/core/cache/htmlPayload.d.ts +0 -5
- package/dist/runtime/core/cache/prerender.d.ts +0 -2
- package/dist/runtime/core/cache/prerender.mjs +0 -5
- package/dist/runtime/core/env/assets.d.ts +0 -1
- package/dist/runtime/core/env/assets.mjs +0 -11
- package/dist/runtime/core/font/fetch.mjs +0 -36
- package/dist/runtime/core/html/applyEmojis.mjs +0 -37
- package/dist/runtime/core/html/applyInlineCss.mjs +0 -32
- package/dist/runtime/core/html/devIframeTemplate.d.ts +0 -2
- package/dist/runtime/core/html/fetchIsland.d.ts +0 -3
- package/dist/runtime/core/html/fetchIsland.mjs +0 -17
- package/dist/runtime/core/options/extract.d.ts +0 -3
- package/dist/runtime/core/options/extract.mjs +0 -49
- package/dist/runtime/core/options/fetch.d.ts +0 -3
- package/dist/runtime/core/options/fetch.mjs +0 -32
- package/dist/runtime/core/renderers/satori/plugins/encoding.mjs +0 -8
- package/dist/runtime/core/renderers/satori/plugins/imageSrc.mjs +0 -75
- package/dist/runtime/core/renderers/satori/plugins/twClasses.mjs +0 -8
- package/dist/runtime/core/utils/resolveRendererContext.d.ts +0 -3
- package/dist/runtime/core/utils/resolveRendererContext.mjs +0 -97
- package/dist/runtime/nitro/utils.d.ts +0 -2
- package/dist/runtime/nitro/utils.mjs +0 -16
- package/dist/runtime/server/assets/inter-latin-ext-400-normal.woff +0 -0
- package/dist/runtime/server/assets/inter-latin-ext-700-normal.woff +0 -0
- /package/dist/client/_nuxt/{error-500.69009e70.css → error-500.BIuFL0tW.css} +0 -0
- /package/dist/runtime/{core/bindings/chromium/node.d.ts → nitro/og-image/bindings/chromium/chrome-launcher.d.ts} +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/resvg/node.d.ts +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/resvg/node.mjs +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/resvg/wasm-fs.d.ts +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/resvg/wasm.d.ts +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/satori/node.d.ts +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/satori/node.mjs +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/satori/wasm-fs.d.ts +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/satori/wasm.d.ts +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/sharp/node.d.ts +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/sharp/node.mjs +0 -0
- /package/dist/runtime/{core/renderers/chromium/index.d.ts → nitro/og-image/chromium/renderer.d.ts} +0 -0
- /package/dist/runtime/{core/renderers/chromium/index.mjs → nitro/og-image/chromium/renderer.mjs} +0 -0
- /package/dist/runtime/{core/renderers → nitro/og-image}/chromium/screenshot.d.ts +0 -0
- /package/dist/runtime/{core/renderers/satori/plugins/emojis.d.ts → nitro/og-image/satori/plugins/classes.d.ts} +0 -0
- /package/dist/runtime/{core/renderers/satori/plugins/encoding.d.ts → nitro/og-image/satori/plugins/emojis.d.ts} +0 -0
- /package/dist/runtime/{core/renderers → nitro/og-image}/satori/plugins/emojis.mjs +0 -0
- /package/dist/runtime/{core/renderers/satori/plugins/flex.d.ts → nitro/og-image/satori/plugins/encoding.d.ts} +0 -0
- /package/dist/runtime/{core/renderers/satori/plugins/imageSrc.d.ts → nitro/og-image/satori/plugins/flex.d.ts} +0 -0
- /package/dist/runtime/{core/renderers → nitro/og-image}/satori/plugins/flex.mjs +0 -0
- /package/dist/runtime/{core/renderers/satori/plugins/twClasses.d.ts → nitro/og-image/satori/plugins/imageSrc.d.ts} +0 -0
- /package/dist/runtime/{core/renderers → nitro/og-image}/satori/plugins/unocss.d.ts +0 -0
- /package/dist/runtime/{core/renderers → nitro/og-image}/satori/plugins/unocss.mjs +0 -0
- /package/dist/runtime/{core/renderers/satori/index.d.ts → nitro/og-image/satori/renderer.d.ts} +0 -0
- /package/dist/runtime/{core/renderers → nitro/og-image}/satori/utils.d.ts +0 -0
- /package/dist/runtime/{core/renderers → nitro/og-image}/satori/utils.mjs +0 -0
- /package/dist/runtime/{core/renderers → nitro/og-image}/satori/vnodes.d.ts +0 -0
- /package/dist/runtime/{server/routes/__og-image__/font-[name]-[weight].[extension].d.ts → nitro/routes/font.d.ts} +0 -0
- /package/dist/runtime/{server/routes/__og-image__ → nitro/routes}/image.d.ts +0 -0
- /package/dist/runtime/{cache.mjs → nitro/util/cache.mjs} +0 -0
- /package/dist/runtime/{core/utils → nitro/util}/wasm.d.ts +0 -0
- /package/dist/runtime/{core/utils → nitro/util}/wasm.mjs +0 -0
- /package/dist/runtime/{components → nuxt/components}/OgImage/OgImage.mjs +0 -0
- /package/dist/runtime/{components → nuxt/components}/OgImage/OgImageScreenshot.mjs +0 -0
- /package/dist/runtime/{components → nuxt/components}/Templates/Community/BrandedLogo.vue +0 -0
- /package/dist/runtime/{components → nuxt/components}/Templates/Community/Nuxt.vue +0 -0
- /package/dist/runtime/{components → nuxt/components}/Templates/Community/Pergel.vue +0 -0
- /package/dist/runtime/{components → nuxt/components}/Templates/Community/SimpleBlog.vue +0 -0
- /package/dist/runtime/{components → nuxt/components}/Templates/Community/Wave.vue +0 -0
- /package/dist/runtime/{components → nuxt/components}/Templates/Community/WithEmoji.vue +0 -0
- /package/dist/runtime/{composables → nuxt/composables}/defineOgImageComponent.mjs +0 -0
- /package/dist/runtime/{composables → nuxt/composables}/defineOgImageScreenshot.mjs +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { NuxtIslandResponse } from 'nuxt/dist/core/runtime/nitro/renderer';
|
|
2
|
-
import type { OgImageRenderEventContext } from '
|
|
2
|
+
import type { OgImageRenderEventContext } from '../../../../types';
|
|
3
3
|
export declare function applyInlineCss({ e }: OgImageRenderEventContext, island: NuxtIslandResponse): Promise<boolean>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useCssInline } from "../instances.mjs";
|
|
2
|
+
import { useNitroOrigin } from "#imports";
|
|
3
|
+
import cssInline from "#nuxt-og-image/bindings/css-inline";
|
|
4
|
+
export async function applyInlineCss({ e }, island) {
|
|
5
|
+
let html = island.html;
|
|
6
|
+
if (!cssInline.__unenv__) {
|
|
7
|
+
let css = island.head.style.map((s) => s.innerHTML).join("\n");
|
|
8
|
+
const componentInlineStyles = island.head.link.filter((l) => l.href.startsWith("/_nuxt/components"));
|
|
9
|
+
if (process.dev) {
|
|
10
|
+
const linksToCss = componentInlineStyles.length ? (await Promise.all(
|
|
11
|
+
componentInlineStyles.map((l) => {
|
|
12
|
+
const url = l.href.endsWith("lang.css") ? `${l.href}&hmr=false` : l.href;
|
|
13
|
+
return e.$fetch(url, {
|
|
14
|
+
responseType: "text",
|
|
15
|
+
baseURL: useNitroOrigin(e)
|
|
16
|
+
}).then((res) => {
|
|
17
|
+
if (res.includes("__vite__css"))
|
|
18
|
+
return res.match(/__vite__css = "([^"]+)"/)?.[1];
|
|
19
|
+
return res.trim().split("\n").filter((l2) => !l2.startsWith("//")).join("\n").trim();
|
|
20
|
+
}).catch(() => {
|
|
21
|
+
return "";
|
|
22
|
+
});
|
|
23
|
+
})
|
|
24
|
+
)).join("\n") : "";
|
|
25
|
+
css = `${linksToCss}${css}`;
|
|
26
|
+
}
|
|
27
|
+
if (!css.trim().length)
|
|
28
|
+
return false;
|
|
29
|
+
const cssInline2 = await useCssInline();
|
|
30
|
+
html = cssInline2.inline(island.html, {
|
|
31
|
+
loadRemoteStylesheets: false,
|
|
32
|
+
extraCss: css
|
|
33
|
+
});
|
|
34
|
+
const classes = css.match(/\.([a-zA-Z0-9-_]+)/g)?.map((c) => c.replace(".", ""));
|
|
35
|
+
if (classes)
|
|
36
|
+
html = html.replace(new RegExp(`class="(${classes.join("|")})"`, "g"), "");
|
|
37
|
+
island.html = html;
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
import { html as convertHtmlToSatori } from "satori-html";
|
|
2
|
-
import { fetchIsland } from "../../
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { fetchIsland } from "../../util/kit.mjs";
|
|
3
|
+
import { htmlDecodeQuotes } from "../../util/encoding.mjs";
|
|
4
|
+
import { applyInlineCss } from "./transforms/inlineCss.mjs";
|
|
5
|
+
import { applyEmojis } from "./transforms/emojis.mjs";
|
|
5
6
|
import { walkSatoriTree } from "./utils.mjs";
|
|
6
7
|
import unocss from "./plugins/unocss.mjs";
|
|
7
8
|
import emojis from "./plugins/emojis.mjs";
|
|
8
|
-
import
|
|
9
|
+
import classes from "./plugins/classes.mjs";
|
|
9
10
|
import imageSrc from "./plugins/imageSrc.mjs";
|
|
10
11
|
import flex from "./plugins/flex.mjs";
|
|
11
12
|
import encoding from "./plugins/encoding.mjs";
|
|
12
13
|
export async function createVNodes(ctx) {
|
|
13
14
|
let html = ctx.options.html;
|
|
14
15
|
if (!html) {
|
|
15
|
-
const island = await fetchIsland(ctx);
|
|
16
|
+
const island = await fetchIsland(ctx.e, ctx.options.component, typeof ctx.options.props !== "undefined" ? ctx.options.props : ctx.options);
|
|
17
|
+
island.html = htmlDecodeQuotes(island.html);
|
|
16
18
|
await applyInlineCss(ctx, island);
|
|
17
19
|
await applyEmojis(ctx, island);
|
|
18
20
|
html = island.html;
|
|
19
21
|
}
|
|
20
|
-
const template = `<div
|
|
22
|
+
const template = `<div style="position: relative; display: flex; margin: 0 auto; width: ${ctx.options.width}px; height: ${ctx.options.height}px; overflow: hidden;">${html}</div>`;
|
|
21
23
|
const satoriTree = convertHtmlToSatori(template);
|
|
22
24
|
await walkSatoriTree(ctx, satoriTree, [
|
|
23
25
|
unocss,
|
|
24
26
|
emojis,
|
|
25
|
-
|
|
27
|
+
classes,
|
|
26
28
|
imageSrc,
|
|
27
29
|
flex,
|
|
28
30
|
encoding
|
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
import { createHeadCore } from "@unhead/vue";
|
|
2
2
|
import { renderSSRHead } from "@unhead/ssr";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { fetchIsland } from "
|
|
3
|
+
import { createError } from "h3";
|
|
4
|
+
import { normaliseFontInput, useOgImageRuntimeConfig } from "../../../shared.mjs";
|
|
5
|
+
import { fetchIsland } from "../../util/kit.mjs";
|
|
6
|
+
import { applyEmojis } from "../satori/transforms/emojis.mjs";
|
|
6
7
|
import { theme } from "#nuxt-og-image/unocss-config.mjs";
|
|
7
|
-
export async function
|
|
8
|
+
export async function html(ctx) {
|
|
8
9
|
const { options } = ctx;
|
|
9
10
|
const { fonts } = useOgImageRuntimeConfig();
|
|
10
|
-
|
|
11
|
+
if (!options.component) {
|
|
12
|
+
throw createError({
|
|
13
|
+
statusCode: 500,
|
|
14
|
+
statusMessage: `[Nuxt OG Image] Rendering an invalid component. Received options: ${JSON.stringify(options)}.`
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
const island = await fetchIsland(ctx.e, ctx.options.component, typeof ctx.options.props !== "undefined" ? ctx.options.props : ctx.options);
|
|
11
18
|
const head = createHeadCore();
|
|
12
19
|
head.push(island.head);
|
|
13
20
|
let defaultFontFamily = "sans-serif";
|
|
14
|
-
const
|
|
21
|
+
const normalisedFonts = normaliseFontInput([...options.fonts || [], ...fonts]);
|
|
22
|
+
const firstFont = normalisedFonts[0];
|
|
15
23
|
if (firstFont)
|
|
16
24
|
defaultFontFamily = firstFont.name;
|
|
17
25
|
await applyEmojis(ctx, island);
|
|
18
|
-
let
|
|
26
|
+
let html2 = island.html;
|
|
19
27
|
const googleFonts = {};
|
|
20
28
|
fonts.filter((font) => !font.path).forEach((font) => {
|
|
21
29
|
if (!googleFonts[font.name])
|
|
@@ -98,11 +106,11 @@ svg[data-emoji] {
|
|
|
98
106
|
})
|
|
99
107
|
]
|
|
100
108
|
});
|
|
101
|
-
|
|
109
|
+
html2 = html2.replaceAll(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "");
|
|
102
110
|
const headChunk = await renderSSRHead(head);
|
|
103
111
|
return `<!DOCTYPE html>
|
|
104
112
|
<html ${headChunk.htmlAttrs}>
|
|
105
113
|
<head>${headChunk.headTags}</head>
|
|
106
|
-
<body ${headChunk.bodyAttrs}>${headChunk.bodyTagsOpen}<div data-v-inspector-ignore="true" style="position: relative; display: flex; margin: 0 auto; width: ${options.width}px; height: ${options.height}px; overflow: hidden;">${
|
|
114
|
+
<body ${headChunk.bodyAttrs}>${headChunk.bodyTagsOpen}<div data-v-inspector-ignore="true" style="position: relative; display: flex; margin: 0 auto; width: ${options.width}px; height: ${options.height}px; overflow: hidden;">${html2}</div>${headChunk.bodyTags}</body>
|
|
107
115
|
</html>`;
|
|
108
116
|
}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { defineNitroPlugin } from "nitropack/dist/runtime/plugin";
|
|
2
2
|
import { defu } from "defu";
|
|
3
|
-
import { getOgImagePath, useOgImageRuntimeConfig } from "../../
|
|
3
|
+
import { getOgImagePath, useOgImageRuntimeConfig } from "../../shared.mjs";
|
|
4
4
|
export default defineNitroPlugin((nitroApp) => {
|
|
5
|
+
const { isNuxtContentDocumentDriven, defaults } = useOgImageRuntimeConfig();
|
|
5
6
|
nitroApp.hooks.hook("content:file:afterParse", async (content) => {
|
|
6
7
|
if (content._draft || content._extension !== "md" || content._partial || content.indexable === false || content.index === false)
|
|
7
8
|
return;
|
|
8
|
-
|
|
9
|
+
let path = content.path;
|
|
10
|
+
if (isNuxtContentDocumentDriven)
|
|
11
|
+
path = content._path;
|
|
12
|
+
if (path && content.ogImage) {
|
|
9
13
|
const ogImageConfig = typeof content.ogImage === "object" ? content.ogImage : {};
|
|
10
|
-
const { defaults } = useOgImageRuntimeConfig();
|
|
11
14
|
const optionsWithDefault = defu(ogImageConfig, defaults);
|
|
12
|
-
const src = getOgImagePath(
|
|
15
|
+
const src = getOgImagePath(path, optionsWithDefault);
|
|
13
16
|
const payload = {
|
|
14
17
|
title: content.title,
|
|
15
18
|
excerpt: content.description || content.excerpt,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("nitropack").NitroAppPlugin;
|
|
1
|
+
declare const _default: import("nitropack/dist/runtime/plugin").NitroAppPlugin;
|
|
2
2
|
export default _default;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { parseURL
|
|
1
|
+
import { parseURL } from "ufo";
|
|
2
2
|
import { defineNitroPlugin } from "nitropack/dist/runtime/plugin";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { isInternalRoute } from "../../utils.pure.mjs";
|
|
8
|
-
import { resolvePathCacheKey } from "../utils.mjs";
|
|
9
|
-
import { useRuntimeConfig } from "#internal/nitro";
|
|
3
|
+
import { extractAndNormaliseOgImageOptions, resolvePathCacheKey } from "../og-image/context.mjs";
|
|
4
|
+
import { prerenderOptionsCache } from "../og-image/cache.mjs";
|
|
5
|
+
import { isInternalRoute } from "../../pure.mjs";
|
|
6
|
+
import { createNitroRouteRuleMatcher } from "../util/kit.mjs";
|
|
10
7
|
export default defineNitroPlugin(async (nitro) => {
|
|
11
8
|
if (!import.meta.prerender)
|
|
12
9
|
return;
|
|
@@ -15,14 +12,9 @@ export default defineNitroPlugin(async (nitro) => {
|
|
|
15
12
|
const path = parseURL(ctx.event.path).pathname;
|
|
16
13
|
if (isInternalRoute(path))
|
|
17
14
|
return;
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
);
|
|
22
|
-
const routeRules = defu({}, ..._routeRulesMatcher.matchAll(
|
|
23
|
-
withoutBase(path.split("?")[0], runtimeConfig.app.baseURL)
|
|
24
|
-
).reverse()).ogImage;
|
|
25
|
-
if (routeRules === false)
|
|
15
|
+
const routeRuleMatcher = createNitroRouteRuleMatcher();
|
|
16
|
+
const routeRules = routeRuleMatcher(path);
|
|
17
|
+
if (routeRules.ogImage === false)
|
|
26
18
|
return;
|
|
27
19
|
const options = extractAndNormaliseOgImageOptions([
|
|
28
20
|
head.join("\n"),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<{
|
|
2
2
|
componentNames: any;
|
|
3
|
-
runtimeConfig: import("
|
|
3
|
+
runtimeConfig: import("../../types").OgImageRuntimeConfig;
|
|
4
4
|
compatibility: any;
|
|
5
5
|
}>>;
|
|
6
6
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineEventHandler, setHeader } from "h3";
|
|
2
|
-
import { useOgImageRuntimeConfig } from "
|
|
2
|
+
import { useOgImageRuntimeConfig } from "../../shared.mjs";
|
|
3
3
|
import compatibility from "#nuxt-og-image/compatibility";
|
|
4
4
|
import { componentNames } from "#nuxt-og-image/component-names.mjs";
|
|
5
5
|
export default defineEventHandler(async (e) => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { createError, defineEventHandler, proxyRequest, sendRedirect } from "h3";
|
|
1
|
+
import { createError, defineEventHandler, getQuery, proxyRequest, sendRedirect } from "h3";
|
|
2
2
|
import { parseURL } from "ufo";
|
|
3
|
+
import { normaliseFontInput, useOgImageRuntimeConfig } from "../../shared.mjs";
|
|
3
4
|
export default defineEventHandler(async (e) => {
|
|
4
5
|
const path = parseURL(e.path).pathname;
|
|
5
6
|
const [_name, _weight] = path.split("/font/")[1].split(".")[0].split("/");
|
|
@@ -7,6 +8,22 @@ export default defineEventHandler(async (e) => {
|
|
|
7
8
|
return "Provide a font name and weight";
|
|
8
9
|
const name = _name[0].toUpperCase() + _name.slice(1);
|
|
9
10
|
const weight = Math.round(Number.parseInt(_weight) / 100) * 100;
|
|
11
|
+
const config = useOgImageRuntimeConfig();
|
|
12
|
+
const normalisedFonts = normaliseFontInput(config.fonts);
|
|
13
|
+
let font;
|
|
14
|
+
if (typeof getQuery(e).font === "string")
|
|
15
|
+
font = JSON.parse(getQuery(e).font);
|
|
16
|
+
if (!font) {
|
|
17
|
+
font = normalisedFonts.find((font2) => {
|
|
18
|
+
return font2.name.toLowerCase() === name.toLowerCase() && weight === Number(font2.weight);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
if (!font) {
|
|
22
|
+
return createError({
|
|
23
|
+
statusCode: 404,
|
|
24
|
+
statusMessage: `[Nuxt OG Image] Font ${name}:${weight} not found`
|
|
25
|
+
});
|
|
26
|
+
}
|
|
10
27
|
const css = await globalThis.$fetch(`https://fonts.googleapis.com/css2?family=${name}:wght@${weight}`, {
|
|
11
28
|
headers: {
|
|
12
29
|
// Make sure it returns TTF.
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { H3Error, createError, defineEventHandler, getQuery, setHeader } from "h3";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { useOgImageBufferCache } from "../../../cache.mjs";
|
|
7
|
-
import { useOgImageRuntimeConfig } from "../../../utils.mjs";
|
|
2
|
+
import { useOgImageBufferCache } from "../util/cache.mjs";
|
|
3
|
+
import { useOgImageRuntimeConfig } from "../../shared.mjs";
|
|
4
|
+
import { resolveContext } from "../og-image/context.mjs";
|
|
5
|
+
import { html } from "../og-image/templates/html.mjs";
|
|
8
6
|
export default defineEventHandler(async (e) => {
|
|
9
|
-
const ctx = await
|
|
7
|
+
const ctx = await resolveContext(e);
|
|
10
8
|
if (ctx instanceof H3Error)
|
|
11
9
|
return ctx;
|
|
12
10
|
const { isDebugJsonPayload, extension, options, renderer } = ctx;
|
|
@@ -18,10 +16,11 @@ export default defineEventHandler(async (e) => {
|
|
|
18
16
|
compatibilityHints.push("Converting PNGs to JPEGs requires Sharp which only runs on Node based systems.");
|
|
19
17
|
if (options.renderer === "chromium")
|
|
20
18
|
compatibilityHints.push("Using Chromium to generate images is only supported in Node based environments. It's recommended to only use this if you're prerendering");
|
|
21
|
-
if (options.component !== "PageScreenshot" && await applyInlineCss(ctx, await fetchIsland(ctx)))
|
|
22
|
-
compatibilityHints.push("Inlining CSS is only supported in Node based environments.");
|
|
23
19
|
setHeader(e, "Content-Type", "application/json");
|
|
24
20
|
return {
|
|
21
|
+
siteConfig: {
|
|
22
|
+
url: e.context.siteConfig.get().url
|
|
23
|
+
},
|
|
25
24
|
compatibilityHints,
|
|
26
25
|
cacheKey: ctx.key,
|
|
27
26
|
options: ctx.options,
|
|
@@ -31,7 +30,7 @@ export default defineEventHandler(async (e) => {
|
|
|
31
30
|
switch (extension) {
|
|
32
31
|
case "html":
|
|
33
32
|
setHeader(e, "Content-Type", `text/html`);
|
|
34
|
-
return
|
|
33
|
+
return html(ctx);
|
|
35
34
|
case "svg":
|
|
36
35
|
if (!debug && !import.meta.dev) {
|
|
37
36
|
return createError({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type H3Error } from 'h3';
|
|
2
|
-
import type { OgImageRenderEventContext } from '
|
|
2
|
+
import type { OgImageRenderEventContext } from '../../types';
|
|
3
3
|
export declare function useOgImageBufferCache(ctx: OgImageRenderEventContext, options: {
|
|
4
4
|
baseCacheKey: string | false;
|
|
5
5
|
cacheMaxAgeSeconds?: number;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function htmlDecodeQuotes(html) {
|
|
2
|
+
return html.replace(/"/g, '"').replace(/'/g, "'").replace(/'/g, "'");
|
|
3
|
+
}
|
|
4
|
+
export function decodeHtml(html) {
|
|
5
|
+
return html.replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&").replace(/¢/g, "\xA2").replace(/£/g, "\xA3").replace(/¥/g, "\xA5").replace(/€/g, "\u20AC").replace(/©/g, "\xA9").replace(/®/g, "\xAE").replace(/"/g, '"').replace(/'/g, "'").replace(/'/g, "'").replace(///g, "/").replace(/&#([0-9]+);/g, (full, int) => {
|
|
6
|
+
return String.fromCharCode(Number.parseInt(int));
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
export function decodeObjectHtmlEntities(obj) {
|
|
10
|
+
Object.entries(obj).forEach(([key, value]) => {
|
|
11
|
+
if (typeof value === "string")
|
|
12
|
+
obj[key] = decodeHtml(value);
|
|
13
|
+
});
|
|
14
|
+
return obj;
|
|
15
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { NitroRouteRules } from 'nitropack';
|
|
2
|
+
import type { H3Event } from 'h3';
|
|
3
|
+
import type { NuxtIslandResponse } from 'nuxt/dist/core/runtime/nitro/renderer';
|
|
4
|
+
export declare function fetchIsland(e: H3Event, component: string, props: Record<string, any>): Promise<NuxtIslandResponse>;
|
|
5
|
+
export declare function withoutQuery(path: string): string;
|
|
6
|
+
export declare function createNitroRouteRuleMatcher(): ((path: string) => NitroRouteRules);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createRouter as createRadixRouter, toRouteMatcher } from "radix3";
|
|
2
|
+
import { defu } from "defu";
|
|
3
|
+
import { withoutBase, withoutTrailingSlash } from "ufo";
|
|
4
|
+
import { hash } from "ohash";
|
|
5
|
+
import { useRuntimeConfig } from "#imports";
|
|
6
|
+
export function fetchIsland(e, component, props) {
|
|
7
|
+
const hashId = hash([component, props]);
|
|
8
|
+
return e.$fetch(`/__nuxt_island/${component}_${hashId}.json`, {
|
|
9
|
+
params: {
|
|
10
|
+
props: JSON.stringify(props)
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export function withoutQuery(path) {
|
|
15
|
+
return path.split("?")[0];
|
|
16
|
+
}
|
|
17
|
+
export function createNitroRouteRuleMatcher() {
|
|
18
|
+
const { nitro, app } = useRuntimeConfig();
|
|
19
|
+
const _routeRulesMatcher = toRouteMatcher(
|
|
20
|
+
createRadixRouter({
|
|
21
|
+
routes: Object.fromEntries(
|
|
22
|
+
Object.entries(nitro?.routeRules || {}).map(([path, rules]) => [withoutTrailingSlash(path), rules])
|
|
23
|
+
)
|
|
24
|
+
})
|
|
25
|
+
);
|
|
26
|
+
return (path) => {
|
|
27
|
+
return defu({}, ..._routeRulesMatcher.matchAll(
|
|
28
|
+
// radix3 does not support trailing slashes
|
|
29
|
+
withoutBase(withoutTrailingSlash(withoutQuery(path)), app.baseURL)
|
|
30
|
+
).reverse());
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { OgImageOptions } from '
|
|
2
|
-
declare const _default: import("vue").DefineComponent<OgImageOptions<"NuxtSeo">, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
1
|
+
import type { OgImageOptions } from '../../../types';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<OgImageOptions<"NuxtSeo">, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<OgImageOptions<"NuxtSeo">>, {
|
|
3
3
|
props?: any;
|
|
4
4
|
}, {}>;
|
|
5
5
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { OgImagePageScreenshotOptions } from '
|
|
2
|
-
declare const _default: import("vue").DefineComponent<OgImagePageScreenshotOptions, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
1
|
+
import type { OgImagePageScreenshotOptions } from '../../../types';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<OgImagePageScreenshotOptions, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<OgImagePageScreenshotOptions>, {
|
|
3
3
|
props?: any;
|
|
4
4
|
}, {}>;
|
|
5
5
|
export default _default;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* @credits @arashsheyda <https://github.com/arashsheyda>
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
withDefaults(defineProps<{
|
|
7
|
+
title?: string
|
|
8
|
+
description?: string
|
|
9
|
+
bg?: string
|
|
10
|
+
icon?: string
|
|
11
|
+
logo?: string
|
|
12
|
+
image?: string
|
|
13
|
+
username?: string
|
|
14
|
+
socials?: { name: string, icon: string }[]
|
|
15
|
+
}>(), {
|
|
16
|
+
bg: 'linear-gradient(to bottom right, #171717, #131313)',
|
|
17
|
+
})
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<div
|
|
22
|
+
class="relative h-full w-full flex items-center justify-center bg-neutral-900 text-white border-2 border-white"
|
|
23
|
+
:style="{ backgroundImage: bg }"
|
|
24
|
+
>
|
|
25
|
+
<div
|
|
26
|
+
v-if="image"
|
|
27
|
+
class="absolute inset-0 w-full h-full bg-center opacity-10"
|
|
28
|
+
:style="{ backgroundImage: `url(${image})` }"
|
|
29
|
+
/>
|
|
30
|
+
<div class="flex flex-col items-center text-center">
|
|
31
|
+
<h1 class="flex gap-4 text-7xl font-bold">
|
|
32
|
+
<Icon
|
|
33
|
+
v-if="icon"
|
|
34
|
+
:name="icon"
|
|
35
|
+
/>
|
|
36
|
+
{{ title }}
|
|
37
|
+
</h1>
|
|
38
|
+
<p class="text-2xl max-w-3xl">
|
|
39
|
+
{{ description }}
|
|
40
|
+
</p>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<img
|
|
44
|
+
v-if="logo"
|
|
45
|
+
:src="logo"
|
|
46
|
+
class="absolute bottom-0 left-0 p-5"
|
|
47
|
+
style="height: 125px; width: 153px;"
|
|
48
|
+
>
|
|
49
|
+
<div class="absolute bottom-5 right-5 flex gap-4">
|
|
50
|
+
<div
|
|
51
|
+
v-if="username"
|
|
52
|
+
class="absolute bottom-12 right-8 font-bold"
|
|
53
|
+
>
|
|
54
|
+
{{ username }}
|
|
55
|
+
</div>
|
|
56
|
+
<Icon
|
|
57
|
+
v-for="social of socials"
|
|
58
|
+
:key="social.name"
|
|
59
|
+
:name="social.icon!"
|
|
60
|
+
class="w-7 h-7"
|
|
61
|
+
/>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</template>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { computed, defineComponent, h, resolveComponent } from 'vue'
|
|
7
|
-
import { useOgImageRuntimeConfig } from '
|
|
7
|
+
import { useOgImageRuntimeConfig } from '../../../../shared'
|
|
8
8
|
import { useSiteConfig } from '#imports'
|
|
9
9
|
|
|
10
10
|
// convert to typescript props
|
|
@@ -25,10 +25,10 @@ const org = computed(() => props.title.split('/')[0])
|
|
|
25
25
|
const repo = computed(() => props.title.split('/')[1])
|
|
26
26
|
|
|
27
27
|
const stars = computed(() => {
|
|
28
|
-
return new Intl.NumberFormat('en-US', { notation: 'compact', compactDisplay: 'short' }).format(props.stars || 0)
|
|
28
|
+
return new Intl.NumberFormat('en-US', { notation: 'compact', compactDisplay: 'short' }).format(Number(props.stars || 0))
|
|
29
29
|
})
|
|
30
30
|
const downloads = computed(() => new Intl.NumberFormat('en-US', { notation: 'compact', compactDisplay: 'short' })
|
|
31
|
-
.format(props.downloads || 0),
|
|
31
|
+
.format(Number(props.downloads || 0)),
|
|
32
32
|
)
|
|
33
33
|
|
|
34
34
|
const description = computed(() => (props.description || '').slice(0, 200))
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { DefineOgImageInput } from '
|
|
1
|
+
import type { DefineOgImageInput } from '../../types';
|
|
2
2
|
export declare function defineOgImage(_options?: DefineOgImageInput): void;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { defu } from "defu";
|
|
2
2
|
import { appendHeader } from "h3";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { useNuxtApp, useRequestEvent, useRoute, useRuntimeConfig } from "#imports";
|
|
3
|
+
import { getOgImagePath, separateProps, useOgImageRuntimeConfig } from "../../shared.mjs";
|
|
4
|
+
import { createOgImageMeta, normaliseOptions } from "../utils.mjs";
|
|
5
|
+
import { createNitroRouteRuleMatcher } from "../../nitro/util/kit.mjs";
|
|
6
|
+
import { useNuxtApp, useRequestEvent, useRoute } from "#imports";
|
|
8
7
|
export function defineOgImage(_options = {}) {
|
|
9
8
|
if (!import.meta.server)
|
|
10
9
|
return;
|
|
@@ -12,12 +11,8 @@ export function defineOgImage(_options = {}) {
|
|
|
12
11
|
const ogImageInstances = nuxtApp.ssrContext._ogImageInstances || [];
|
|
13
12
|
const route = useRoute();
|
|
14
13
|
const basePath = route.path || "/";
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
);
|
|
18
|
-
const routeRules = defu({}, ..._routeRulesMatcher.matchAll(
|
|
19
|
-
withoutBase(withoutQuery(basePath), useRuntimeConfig().app.baseURL)
|
|
20
|
-
).reverse()).ogImage;
|
|
14
|
+
const routeRuleMatcher = createNitroRouteRuleMatcher();
|
|
15
|
+
const routeRules = routeRuleMatcher(basePath).ogImage;
|
|
21
16
|
if (!_options || nuxtApp.ssrContext?.event.context._nitro?.routeRules?.ogImage === false || typeof routeRules !== "undefined" && routeRules === false) {
|
|
22
17
|
ogImageInstances.forEach((e) => {
|
|
23
18
|
e.dispose();
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { ExtractComponentProps, OgImageOptions } from '
|
|
1
|
+
import type { ExtractComponentProps, OgImageOptions } from '../../types';
|
|
2
2
|
import type { OgImageComponents } from '#nuxt-og-image/components';
|
|
3
3
|
export declare function defineOgImageComponent<T extends keyof OgImageComponents>(component: T, props?: Partial<ExtractComponentProps<OgImageComponents[T]>>, options?: OgImageOptions): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { OgImagePageScreenshotOptions } from '
|
|
1
|
+
import type { OgImagePageScreenshotOptions } from '../../types';
|
|
2
2
|
export declare function defineOgImageScreenshot(options?: OgImagePageScreenshotOptions): any;
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { parseURL } from "ufo";
|
|
2
2
|
import { toValue } from "vue";
|
|
3
3
|
import { defu } from "defu";
|
|
4
|
-
import { isInternalRoute, separateProps } from "../../
|
|
4
|
+
import { isInternalRoute, separateProps } from "../../pure.mjs";
|
|
5
5
|
import { defineNuxtPlugin, useRequestEvent, withSiteUrl } from "#imports";
|
|
6
6
|
export default defineNuxtPlugin({
|
|
7
7
|
setup(nuxtApp) {
|
|
@@ -15,20 +15,29 @@ export default defineNuxtPlugin({
|
|
|
15
15
|
key: "nuxt-og-image:overrides-and-canonical-urls",
|
|
16
16
|
hooks: {
|
|
17
17
|
"tags:resolve": async (ctx2) => {
|
|
18
|
+
const hasPrimaryPayload = ctx2.tags.some((tag) => tag.tag === "script" && tag.props.id === "nuxt-og-image-options");
|
|
18
19
|
let overrides;
|
|
19
20
|
for (const tag of ctx2.tags) {
|
|
20
21
|
if (tag.tag === "script" && tag.props.id === "nuxt-og-image-overrides") {
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
if (hasPrimaryPayload) {
|
|
23
|
+
overrides = separateProps(JSON.parse(tag.innerHTML || "{}"));
|
|
24
|
+
delete ctx2.tags[ctx2.tags.indexOf(tag)];
|
|
25
|
+
} else {
|
|
26
|
+
tag.props.id = "nuxt-og-image-options";
|
|
27
|
+
tag.innerHTML = JSON.stringify(separateProps(JSON.parse(tag.innerHTML || "{}")));
|
|
28
|
+
tag._d = "script:id:nuxt-og-image-options";
|
|
29
|
+
}
|
|
23
30
|
break;
|
|
24
31
|
}
|
|
25
32
|
}
|
|
26
33
|
ctx2.tags = ctx2.tags.filter(Boolean);
|
|
27
34
|
for (const tag of ctx2.tags) {
|
|
28
|
-
if (tag.tag === "meta" && (tag.props.property === "og:image" ||
|
|
35
|
+
if (tag.tag === "meta" && (tag.props.property === "og:image" || ["twitter:image:src", "twitter:image"].includes(tag.props.name))) {
|
|
29
36
|
if (!tag.props.content.startsWith("https")) {
|
|
30
37
|
await nuxtApp.runWithContext(() => {
|
|
31
|
-
tag.props.content = toValue(withSiteUrl(tag.props.content
|
|
38
|
+
tag.props.content = toValue(withSiteUrl(tag.props.content, {
|
|
39
|
+
withBase: true
|
|
40
|
+
}));
|
|
32
41
|
});
|
|
33
42
|
}
|
|
34
43
|
} else if (overrides && tag.tag === "script" && tag.props.id === "nuxt-og-image-options") {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defu } from "defu";
|
|
2
2
|
import { parseURL, withoutBase } from "ufo";
|
|
3
3
|
import { createRouter as createRadixRouter, toRouteMatcher } from "radix3";
|
|
4
|
-
import { getOgImagePath, isInternalRoute, useOgImageRuntimeConfig } from "../../
|
|
4
|
+
import { getOgImagePath, isInternalRoute, useOgImageRuntimeConfig } from "../../shared.mjs";
|
|
5
5
|
import { createOgImageMeta, normaliseOptions } from "../utils.mjs";
|
|
6
6
|
import { defineNuxtPlugin, useRequestEvent } from "#imports";
|
|
7
7
|
export default defineNuxtPlugin((nuxtApp) => {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { NuxtSSRContext } from 'nuxt/app';
|
|
1
2
|
import type { DefineOgImageInput, OgImageOptions, OgImagePrebuilt } from '../types';
|
|
2
|
-
export declare function createOgImageMeta(src: string | null, input: OgImageOptions | OgImagePrebuilt, resolvedOptions: OgImageOptions, ssrContext:
|
|
3
|
+
export declare function createOgImageMeta(src: string | null, input: OgImageOptions | OgImagePrebuilt, resolvedOptions: OgImageOptions, ssrContext: NuxtSSRContext): void;
|
|
3
4
|
export declare function normaliseOptions(_options: DefineOgImageInput): OgImageOptions | OgImagePrebuilt;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defu } from "defu";
|
|
2
2
|
import { withQuery } from "ufo";
|
|
3
|
-
import { getExtension, separateProps } from "../
|
|
3
|
+
import { getExtension, separateProps } from "../shared.mjs";
|
|
4
4
|
import { unref, useServerHead } from "#imports";
|
|
5
5
|
import { componentNames } from "#build/nuxt-og-image/components.mjs";
|
|
6
6
|
export function createOgImageMeta(src, input, resolvedOptions, ssrContext) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { InputFontConfig, OgImageOptions, ResolvedFontConfig } from './types';
|
|
2
|
+
export declare function toBase64Image(fileName: string, data: string | ArrayBuffer): string;
|
|
2
3
|
export declare function isInternalRoute(path: string): boolean;
|
|
3
4
|
export declare function separateProps(options: OgImageOptions | undefined, ignoreKeys?: string[]): {
|
|
4
5
|
props: Record<string, any>;
|