nuxt-og-image 3.0.0-rc.6 → 3.0.0-rc.60
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 +6 -19
- package/dist/client/200.html +265 -15
- package/dist/client/404.html +265 -15
- package/dist/client/_nuxt/-7WWnkdy.js +517 -0
- package/dist/client/_nuxt/0ooBkv16.js +1 -0
- package/dist/client/_nuxt/1Je9_Reo.js +136 -0
- package/dist/client/_nuxt/1rqFXsGc.js +666 -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/8t4jSAMm.js +1 -0
- package/dist/client/_nuxt/9B1nZgL-.js +1 -0
- package/dist/client/_nuxt/9ZOzOPqN.js +1 -0
- package/dist/client/_nuxt/AgnqFTPX.js +13 -0
- package/dist/client/_nuxt/B1nm99XP.js +2 -0
- package/dist/client/_nuxt/B2DkETJQ.js +1 -0
- package/dist/client/_nuxt/B3g-KkBK.js +1 -0
- package/dist/client/_nuxt/B4yE-MfL.js +38 -0
- package/dist/client/_nuxt/B6E6ObS_.js +8 -0
- package/dist/client/_nuxt/B6bHXiXE.js +25 -0
- package/dist/client/_nuxt/B7rNE5kf.js +1 -0
- package/dist/client/_nuxt/B9CT-1u6.js +7 -0
- package/dist/client/_nuxt/B9S9BZZh.js +1 -0
- package/dist/client/_nuxt/BB42E8aY.js +186 -0
- package/dist/client/_nuxt/BBBqETUW.js +1 -0
- package/dist/client/_nuxt/BBDuFDsq.js +1 -0
- package/dist/client/_nuxt/BBJYjQ0k.js +1 -0
- package/dist/client/_nuxt/BEjL32p1.js +5754 -0
- package/dist/client/_nuxt/BF6G6X0H.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/BITGhEdf.js +1 -0
- package/dist/client/_nuxt/BIl_88gt.js +1 -0
- package/dist/client/_nuxt/BIxS-Weu.js +1 -0
- package/dist/client/_nuxt/BLluXI4E.js +1 -0
- package/dist/client/_nuxt/BMHPAh1U.js +2 -0
- package/dist/client/_nuxt/BN4LRXf6.js +4 -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/BT9ZzGyQ.js +69 -0
- package/dist/client/_nuxt/BTtaZsq5.js +1 -0
- package/dist/client/_nuxt/BUpeXbsf.js +25 -0
- package/dist/client/_nuxt/BVGdgKAv.js +1 -0
- package/dist/client/_nuxt/BVLuctcA.js +1 -0
- package/dist/client/_nuxt/BVkeqZ59.js +1 -0
- package/dist/client/_nuxt/BWKJ1FCf.js +239 -0
- package/dist/client/_nuxt/BXF7Vm5l.js +1 -0
- package/dist/client/_nuxt/BXR915QZ.js +32 -0
- package/dist/client/_nuxt/BXTKWaEE.js +1 -0
- package/dist/client/_nuxt/BXfENWL6.js +1 -0
- package/dist/client/_nuxt/BYdKNJ10.js +1 -0
- package/dist/client/_nuxt/BZfs-ost.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/BacI6-DX.js +40 -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/Bdt_eLrj.js +756 -0
- package/dist/client/_nuxt/BeJnKnI_.js +544 -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/Bgpqy2XC.js +1 -0
- package/dist/client/_nuxt/Bh8mriwU.js +17 -0
- package/dist/client/_nuxt/Bi43K_FX.js +6 -0
- package/dist/client/_nuxt/BiDE021q.js +1 -0
- package/dist/client/_nuxt/BigF1UXR.js +1 -0
- package/dist/client/_nuxt/Bj0fF4lQ.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/BnyYJeap.js +129 -0
- package/dist/client/_nuxt/Br6ll-O0.js +1 -0
- package/dist/client/_nuxt/BscxmKrE.js +8 -0
- package/dist/client/_nuxt/BsvsQ1iS.js +1 -0
- package/dist/client/_nuxt/Btshr8M_.js +70 -0
- package/dist/client/_nuxt/BvCdDh2R.js +1 -0
- package/dist/client/_nuxt/BwXNTs7T.js +1 -0
- package/dist/client/_nuxt/Bxkoe-BC.js +1 -0
- package/dist/client/_nuxt/BxwAa5i0.js +1 -0
- package/dist/client/_nuxt/ByMv4Xf1.js +1 -0
- package/dist/client/_nuxt/C15OxdQ5.js +1 -0
- package/dist/client/_nuxt/C1DVX8_8.js +831 -0
- package/dist/client/_nuxt/C1yTBzia.js +1 -0
- package/dist/client/_nuxt/C2TBxDwV.js +1 -0
- package/dist/client/_nuxt/C3qJFuQy.js +3 -0
- package/dist/client/_nuxt/C3qUB5O8.js +301 -0
- package/dist/client/_nuxt/C6Aznpr-.js +1 -0
- package/dist/client/_nuxt/C6XIsc4F.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/CA9nliXM.js +1 -0
- package/dist/client/_nuxt/CApMHEaB.js +1 -0
- package/dist/client/_nuxt/CBPJd_fO.js +1 -0
- package/dist/client/_nuxt/CBWrHyXe.js +580 -0
- package/dist/client/_nuxt/CCqFro8U.js +3 -0
- package/dist/client/_nuxt/CEfge3mM.js +1 -0
- package/dist/client/_nuxt/CFF2d1j6.js +1 -0
- package/dist/client/_nuxt/CG4fK2Nq.js +21 -0
- package/dist/client/_nuxt/CGmujMTu.js +1 -0
- package/dist/client/_nuxt/CJGKC1_q.js +40 -0
- package/dist/client/_nuxt/CJIaz0BQ.js +76 -0
- package/dist/client/_nuxt/CJQrLysU.js +1 -0
- package/dist/client/_nuxt/CMDmr8et.js +2 -0
- package/dist/client/_nuxt/CO5hpdkB.js +1 -0
- package/dist/client/_nuxt/CO7HdiM_.js +1 -0
- package/dist/client/_nuxt/CQUCfALx.js +13 -0
- package/dist/client/_nuxt/CRDKj6ck.js +1 -0
- package/dist/client/_nuxt/CRlnGVMD.js +1 -0
- package/dist/client/_nuxt/CSPeAESR.js +1 -0
- package/dist/client/_nuxt/CThH5sBG.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/C_ZPRiAj.js +26 -0
- package/dist/client/_nuxt/CarfVElc.js +80 -0
- package/dist/client/_nuxt/Cb-F_BZP.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/Cgl53LJQ.js +1 -0
- package/dist/client/_nuxt/CgwOUXSn.js +1 -0
- package/dist/client/_nuxt/ChH25C4w.js +1 -0
- package/dist/client/_nuxt/ChMCFiS0.js +1 -0
- package/dist/client/_nuxt/CiRxTSAc.js +1 -0
- package/dist/client/_nuxt/Cicx_DS6.js +1 -0
- package/dist/client/_nuxt/ClXEvkw9.js +68 -0
- package/dist/client/_nuxt/CowR2XfX.js +1 -0
- package/dist/client/_nuxt/Cp2HGa90.js +353 -0
- package/dist/client/_nuxt/CpAANOdC.js +1 -0
- package/dist/client/_nuxt/CqYeW6XZ.js +1 -0
- package/dist/client/_nuxt/CrgTADc5.js +1 -0
- package/dist/client/_nuxt/CrhH3_Og.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/CuJfdYLG.js +1 -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/D33OKbkv.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/D6pmzCqS.js +1 -0
- package/dist/client/_nuxt/D71BffLY.js +1 -0
- package/dist/client/_nuxt/D7WeZTai.js +1 -0
- package/dist/client/_nuxt/DAGYewaG.js +559 -0
- package/dist/client/_nuxt/DAP_O-zg.js +1 -0
- package/dist/client/_nuxt/DAVo6uMX.js +1 -0
- package/dist/client/_nuxt/DAfrLhwG.js +1 -0
- package/dist/client/_nuxt/DBeuZS66.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/DGDuLtS6.js +8 -0
- package/dist/client/_nuxt/DGEpfOTx.js +1 -0
- package/dist/client/_nuxt/DGO8GyiP.js +1 -0
- package/dist/client/_nuxt/DGxQkqYo.js +1 -0
- package/dist/client/_nuxt/DHmGyzbM.js +109 -0
- package/dist/client/_nuxt/DJZWsvj0.js +1 -0
- package/dist/client/_nuxt/DJubGRtk.js +1 -0
- package/dist/client/_nuxt/DK4oFTHQ.js +200 -0
- package/dist/client/_nuxt/DKb4lQY2.js +1 -0
- package/dist/client/_nuxt/DLP9ZvWb.js +3 -0
- package/dist/client/_nuxt/DM4HHECw.js +1 -0
- package/dist/client/_nuxt/DNR26wTC.js +1 -0
- package/dist/client/_nuxt/DOHBU7tp.js +1 -0
- package/dist/client/_nuxt/DOqtC9FP.js +1 -0
- package/dist/client/_nuxt/DOtRmeXT.js +1 -0
- package/dist/client/_nuxt/DR5YgmI2.js +1 -0
- package/dist/client/_nuxt/DS9ZWoKD.js +1 -0
- package/dist/client/_nuxt/DSrLtGYv.js +15 -0
- package/dist/client/_nuxt/DSsji4Hu.js +1 -0
- package/dist/client/_nuxt/DV9JwLIa.js +1 -0
- package/dist/client/_nuxt/DVC_qXWv.js +1 -0
- package/dist/client/_nuxt/DVLwECkk.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/DY7_9Ga-.js +1 -0
- package/dist/client/_nuxt/DYI1rfmx.js +25 -0
- package/dist/client/_nuxt/DZLoTQm4.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/Dd6f7Z5P.js +1 -0
- package/dist/client/_nuxt/DdacRhvC.js +1 -0
- package/dist/client/_nuxt/DeVv6D4_.js +1 -0
- package/dist/client/_nuxt/DfeQjIbs.js +5 -0
- package/dist/client/_nuxt/Dg0DGYq4.js +14 -0
- package/dist/client/_nuxt/DhFF74a2.js +1 -0
- package/dist/client/_nuxt/Dit6kIrv.js +11 -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/DouzTJIq.js +1 -0
- package/dist/client/_nuxt/DrnZp123.js +40 -0
- package/dist/client/_nuxt/DsfXcHUZ.js +29 -0
- package/dist/client/_nuxt/Du6_OKDb.js +159 -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/DzwdaLuO.js +223 -0
- package/dist/client/_nuxt/ECt0lbkd.js +16 -0
- package/dist/client/_nuxt/Eh5U-gDp.js +52 -0
- package/dist/client/_nuxt/FJDVp-XM.js +1 -0
- package/dist/client/_nuxt/HrnDn_2Q.js +1 -0
- package/dist/client/_nuxt/I4qd5QHW.js +10 -0
- package/dist/client/_nuxt/JgH_6NEN.js +1 -0
- package/dist/client/_nuxt/KEYLhlmT.js +1 -0
- package/dist/client/_nuxt/KPqz0Sb3.js +1 -0
- package/dist/client/_nuxt/Ksn5IXup.js +1 -0
- package/dist/client/_nuxt/MS3qTAOR.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/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/UREJT2Bw.js +1 -0
- package/dist/client/_nuxt/Urb1RsFe.js +1 -0
- package/dist/client/_nuxt/VQMr7AbF.js +1 -0
- package/dist/client/_nuxt/YxQm0tCS.js +1 -0
- package/dist/client/_nuxt/alpzPJ78.js +1 -0
- package/dist/client/_nuxt/beD-FUib.js +1 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/668fc760-695e-4839-9fe3-12eaadf96dec.json +1 -0
- package/dist/client/_nuxt/cW9vKj3g.js +1 -0
- package/dist/client/_nuxt/cw46T5ID.js +61 -0
- package/dist/client/_nuxt/dIHJ9UdL.js +1 -0
- package/dist/client/_nuxt/eJfcURhx.js +1 -0
- package/dist/client/_nuxt/entry.BCfFhbeW.css +1 -0
- package/dist/client/_nuxt/error-404.B3wjZPBT.css +1 -0
- package/dist/client/_nuxt/error-500.Dxoa4Ooo.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/jaXbsbtS.js +1 -0
- package/dist/client/_nuxt/kuh6G-Sk.js +9 -0
- package/dist/client/_nuxt/nclm9rTJ.js +266 -0
- package/dist/client/_nuxt/qxoleWdb.js +1 -0
- package/dist/client/_nuxt/rS0jd3Ly.js +1 -0
- package/dist/client/_nuxt/rltxq8r8.js +131 -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/xPNGhBYe.js +1 -0
- package/dist/client/_nuxt/yX2IItqj.js +1 -0
- package/dist/client/index.html +265 -15
- package/dist/module.d.mts +9 -106
- package/dist/module.d.ts +9 -106
- package/dist/module.json +6 -2
- package/dist/module.mjs +225 -136
- 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.js +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.js +35 -0
- package/dist/runtime/nitro/og-image/bindings/chromium/playwright.d.ts +2 -0
- package/dist/runtime/nitro/og-image/bindings/chromium/playwright.js +6 -0
- package/dist/runtime/nitro/og-image/bindings/css-inline/node.d.ts +7 -0
- package/dist/runtime/nitro/og-image/bindings/css-inline/node.js +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.js +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.js +7 -0
- package/dist/runtime/{core → nitro/og-image}/bindings/resvg/wasm-fs.d.ts +1 -1
- package/dist/runtime/{core/bindings/resvg/wasm-fs.mjs → nitro/og-image/bindings/resvg/wasm-fs.js} +1 -1
- package/dist/runtime/{core → nitro/og-image}/bindings/resvg/wasm.d.ts +1 -1
- package/dist/runtime/nitro/og-image/bindings/resvg/wasm.js +5 -0
- package/dist/runtime/{core/bindings/satori/wasm-fs.mjs → nitro/og-image/bindings/satori/wasm-fs.js} +1 -1
- package/dist/runtime/{core/bindings/satori/wasm.mjs → nitro/og-image/bindings/satori/wasm.js} +1 -2
- package/dist/runtime/nitro/og-image/cache.d.ts +7 -0
- package/dist/runtime/{core/cache/htmlPayload.mjs → nitro/og-image/cache.js} +4 -1
- package/dist/runtime/{core/renderers/chromium/index.d.ts → nitro/og-image/chromium/renderer.d.ts} +1 -1
- package/dist/runtime/{core/renderers/chromium/index.mjs → nitro/og-image/chromium/renderer.js} +1 -1
- package/dist/runtime/{core/renderers → nitro/og-image}/chromium/screenshot.d.ts +1 -2
- package/dist/runtime/{core/renderers/chromium/screenshot.mjs → nitro/og-image/chromium/screenshot.js} +1 -1
- package/dist/runtime/nitro/og-image/context.d.ts +5 -0
- package/dist/runtime/nitro/og-image/context.js +181 -0
- package/dist/runtime/nitro/og-image/instances.d.ts +2 -0
- package/dist/runtime/nitro/og-image/instances.js +10 -0
- package/dist/runtime/nitro/og-image/satori/font.d.ts +2 -0
- package/dist/runtime/nitro/og-image/satori/font.js +39 -0
- package/dist/runtime/{core/renderers → nitro/og-image}/satori/instances.d.ts +5 -5
- package/dist/runtime/{core/renderers/satori/instances.mjs → nitro/og-image/satori/instances.js} +2 -11
- package/dist/runtime/nitro/og-image/satori/plugins/classes.js +17 -0
- package/dist/runtime/{core/renderers/satori/plugins/emojis.mjs → nitro/og-image/satori/plugins/emojis.js} +2 -2
- package/dist/runtime/nitro/og-image/satori/plugins/encoding.js +17 -0
- package/dist/runtime/{core/renderers/satori/plugins/flex.mjs → nitro/og-image/satori/plugins/flex.js} +2 -2
- package/dist/runtime/nitro/og-image/satori/plugins/imageSrc.js +85 -0
- package/dist/runtime/{core/renderers/satori/plugins/unocss.mjs → nitro/og-image/satori/plugins/unocss.js} +1 -1
- package/dist/runtime/{core/renderers/satori/index.d.ts → nitro/og-image/satori/renderer.d.ts} +1 -1
- package/dist/runtime/{core/renderers/satori/index.mjs → nitro/og-image/satori/renderer.js} +30 -17
- package/dist/runtime/nitro/og-image/satori/transforms/emojis.d.ts +5 -0
- package/dist/runtime/nitro/og-image/satori/transforms/emojis.js +3597 -0
- package/dist/runtime/nitro/og-image/satori/transforms/inlineCss.d.ts +3 -0
- package/dist/runtime/nitro/og-image/satori/transforms/inlineCss.js +42 -0
- package/dist/runtime/{core/renderers → nitro/og-image}/satori/utils.d.ts +2 -2
- package/dist/runtime/{core/renderers/satori/utils.mjs → nitro/og-image/satori/utils.js} +9 -5
- package/dist/runtime/{core/renderers → nitro/og-image}/satori/vnodes.d.ts +1 -1
- package/dist/runtime/nitro/og-image/satori/vnodes.js +38 -0
- package/dist/runtime/nitro/og-image/templates/html.d.ts +2 -0
- package/dist/runtime/{core/html/devIframeTemplate.mjs → nitro/og-image/templates/html.js} +17 -9
- package/dist/runtime/nitro/plugins/nuxt-content.d.ts +1 -1
- package/dist/runtime/nitro/plugins/{nuxt-content.mjs → nuxt-content.js} +7 -4
- package/dist/runtime/nitro/plugins/prerender.js +28 -0
- package/dist/runtime/{server/routes/__og-image__ → nitro/routes}/debug.json.d.ts +1 -1
- package/dist/runtime/{server/routes/__og-image__/debug.json.mjs → nitro/routes/debug.json.js} +1 -1
- package/dist/runtime/{server/routes/__og-image__/font-[name]-[weight].[extension].mjs → nitro/routes/font.js} +22 -5
- package/dist/runtime/{server/routes/__og-image__/image.mjs → nitro/routes/image.js} +9 -10
- package/dist/runtime/nitro/tsconfig.json +3 -0
- package/dist/runtime/{cache.d.ts → nitro/util/cache.d.ts} +2 -2
- package/dist/runtime/{cache.mjs → nitro/util/cache.js} +2 -1
- package/dist/runtime/nitro/util/encoding.d.ts +3 -0
- package/dist/runtime/nitro/util/encoding.js +15 -0
- package/dist/runtime/nitro/util/kit.d.ts +6 -0
- package/dist/runtime/nitro/util/kit.js +32 -0
- package/dist/runtime/{core/utils → nitro/util}/wasm.d.ts +0 -1
- package/dist/runtime/nuxt/components/OgImage/OgImage.d.ts +5 -0
- package/dist/runtime/nuxt/components/OgImage/OgImageScreenshot.d.ts +5 -0
- package/dist/runtime/nuxt/components/Templates/Community/Frame.vue +64 -0
- package/dist/runtime/{components → nuxt/components}/Templates/Community/Nuxt.vue +6 -5
- package/dist/runtime/{components → nuxt/components}/Templates/Community/NuxtSeo.vue +5 -5
- package/dist/runtime/{components → nuxt/components}/Templates/Community/Pergel.vue +1 -2
- 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/defineOgImage.mjs → nuxt/composables/defineOgImage.js} +7 -12
- package/dist/runtime/{composables → nuxt/composables}/defineOgImageComponent.d.ts +1 -1
- package/dist/runtime/{composables/defineOgImageComponent.mjs → nuxt/composables/defineOgImageComponent.js} +1 -1
- package/dist/runtime/nuxt/composables/defineOgImageScreenshot.d.ts +2 -0
- package/dist/runtime/nuxt/composables/mock.d.ts +5 -0
- package/dist/runtime/nuxt/composables/mock.js +6 -0
- package/dist/runtime/nuxt/plugins/og-image-canonical-urls.server.d.ts +1 -1
- package/dist/runtime/nuxt/plugins/{og-image-canonical-urls.server.mjs → og-image-canonical-urls.server.js} +16 -6
- package/dist/runtime/nuxt/plugins/route-rule-og-image.server.d.ts +1 -1
- package/dist/runtime/nuxt/plugins/{route-rule-og-image.server.mjs → route-rule-og-image.server.js} +3 -3
- package/dist/runtime/nuxt/utils.d.ts +3 -2
- package/dist/runtime/nuxt/{utils.mjs → utils.js} +4 -3
- package/dist/runtime/{utils.pure.d.ts → pure.d.ts} +2 -1
- package/dist/runtime/{utils.pure.mjs → pure.js} +22 -3
- package/dist/runtime/{utils.d.ts → shared.d.ts} +2 -2
- package/dist/runtime/{utils.mjs → shared.js} +3 -2
- package/dist/runtime/types.d.ts +14 -6
- package/dist/types.d.mts +2 -9
- package/dist/types.d.ts +2 -9
- package/package.json +83 -58
- package/dist/client/_nuxt/IconCSS.220290da.js +0 -1
- package/dist/client/_nuxt/IconCSS.f0b56d3e.css +0 -1
- package/dist/client/_nuxt/builds/meta/e73d18b8-bd07-4a22-971c-e8ba17519e8f.json +0 -1
- package/dist/client/_nuxt/entry.5d0abb3d.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.e6048d23.js +0 -1
- package/dist/client/_nuxt/error-500.3bcefba1.js +0 -1
- package/dist/client/_nuxt/error-500.69009e70.css +0 -1
- package/dist/client/_nuxt/vanilla-picker-NKbIFE8h.23409a58.js +0 -8
- package/dist/runtime/components/OgImage/OgImage.d.ts +0 -5
- package/dist/runtime/components/OgImage/OgImageScreenshot.d.ts +0 -5
- package/dist/runtime/composables/defineOgImageScreenshot.d.ts +0 -2
- 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.d.ts +0 -2
- package/dist/runtime/core/font/fetch.mjs +0 -36
- package/dist/runtime/core/html/applyEmojis.d.ts +0 -3
- package/dist/runtime/core/html/applyEmojis.mjs +0 -37
- package/dist/runtime/core/html/applyInlineCss.d.ts +0 -3
- 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/renderers/satori/vnodes.mjs +0 -31
- package/dist/runtime/core/utils/resolveRendererContext.d.ts +0 -3
- package/dist/runtime/core/utils/resolveRendererContext.mjs +0 -97
- package/dist/runtime/nitro/plugins/prerender.mjs +0 -36
- 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/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/bindings/resvg/node.mjs → nitro/og-image/bindings/resvg/node.js} +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/satori/node.d.ts +0 -0
- /package/dist/runtime/{core/bindings/satori/node.mjs → nitro/og-image/bindings/satori/node.js} +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/bindings/sharp/node.mjs → nitro/og-image/bindings/sharp/node.js} +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/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/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/{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/{core/utils/wasm.mjs → nitro/util/wasm.js} +0 -0
- /package/dist/runtime/{components/OgImage/OgImage.mjs → nuxt/components/OgImage/OgImage.js} +0 -0
- /package/dist/runtime/{components/OgImage/OgImageScreenshot.mjs → nuxt/components/OgImage/OgImageScreenshot.js} +0 -0
- /package/dist/runtime/{components → nuxt/components}/Templates/Community/BrandedLogo.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/defineOgImageScreenshot.mjs → nuxt/composables/defineOgImageScreenshot.js} +0 -0
- /package/dist/runtime/{types.mjs → types.js} +0 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { useCssInline } from "../instances.js";
|
|
2
|
+
import { useNitroOrigin } from "#imports";
|
|
3
|
+
export async function applyInlineCss(ctx, island) {
|
|
4
|
+
const { e } = ctx;
|
|
5
|
+
let html = island.html;
|
|
6
|
+
let css = island.head.style.map((s) => s.innerHTML).filter(Boolean).join("\n");
|
|
7
|
+
const componentInlineStyles = island.head.link.filter((l) => l.href.startsWith("/_nuxt/components") && l.href.replaceAll("/", "").includes(ctx.options.component));
|
|
8
|
+
if (!import.meta.prerender && !componentInlineStyles.length) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
let linksToCss = [];
|
|
12
|
+
if (import.meta.dev) {
|
|
13
|
+
linksToCss = componentInlineStyles.length ? (await Promise.all(
|
|
14
|
+
componentInlineStyles.map((l) => {
|
|
15
|
+
const url = l.href.endsWith("lang.css") ? `${l.href}&hmr=false` : l.href;
|
|
16
|
+
return e.$fetch(url, {
|
|
17
|
+
responseType: "text",
|
|
18
|
+
baseURL: useNitroOrigin(e)
|
|
19
|
+
}).then((res) => {
|
|
20
|
+
if (res.includes("__vite__css"))
|
|
21
|
+
return res.match(/__vite__css = "([^"]+)"/)?.[1];
|
|
22
|
+
return res.trim().split("\n").filter((l2) => !l2.startsWith("//")).join("\n").trim();
|
|
23
|
+
}).catch(() => {
|
|
24
|
+
return "";
|
|
25
|
+
});
|
|
26
|
+
})
|
|
27
|
+
)).join("\n") : "";
|
|
28
|
+
css = [linksToCss, css].join("\n");
|
|
29
|
+
}
|
|
30
|
+
if (!css.trim().length)
|
|
31
|
+
return false;
|
|
32
|
+
const cssInline = await useCssInline();
|
|
33
|
+
html = cssInline.inline(island.html, {
|
|
34
|
+
loadRemoteStylesheets: false,
|
|
35
|
+
extraCss: css
|
|
36
|
+
});
|
|
37
|
+
const classes = css.match(/\.([\w-]+)/g)?.map((c) => c.replace(".", ""));
|
|
38
|
+
if (classes)
|
|
39
|
+
html = html.replace(new RegExp(`class="(${classes.join("|")})"`, "g"), "");
|
|
40
|
+
island.html = html;
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { OgImageRenderEventContext, SatoriTransformer, VNode } from '../../../types';
|
|
2
|
-
export declare function walkSatoriTree(e: OgImageRenderEventContext, node: VNode, plugins: (SatoriTransformer | SatoriTransformer[])[]): Promise<void
|
|
1
|
+
import type { OgImageRenderEventContext, SatoriTransformer, VNode } from '../../../types.js';
|
|
2
|
+
export declare function walkSatoriTree(e: OgImageRenderEventContext, node: VNode, plugins: (SatoriTransformer | SatoriTransformer[])[]): (void | Promise<void>)[];
|
|
3
3
|
export declare function defineSatoriTransformer(transformer: SatoriTransformer | SatoriTransformer[]): SatoriTransformer | SatoriTransformer[];
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
export
|
|
1
|
+
export function walkSatoriTree(e, node, plugins) {
|
|
2
|
+
const promises = [];
|
|
2
3
|
if (!node.props?.children || !Array.isArray(node.props.children))
|
|
3
|
-
return;
|
|
4
|
+
return promises;
|
|
4
5
|
if (node.props.children.length === 0) {
|
|
5
6
|
delete node.props.children;
|
|
6
|
-
return;
|
|
7
|
+
return promises;
|
|
7
8
|
}
|
|
8
9
|
for (const child of node.props.children || []) {
|
|
9
10
|
if (child) {
|
|
10
11
|
for (const plugin of plugins.flat()) {
|
|
11
12
|
if (plugin.filter(child))
|
|
12
|
-
|
|
13
|
+
promises.push(plugin.transform(child, e));
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
+
promises.push(
|
|
16
|
+
...walkSatoriTree(e, child, plugins)
|
|
17
|
+
);
|
|
15
18
|
}
|
|
16
19
|
}
|
|
20
|
+
return promises;
|
|
17
21
|
}
|
|
18
22
|
export function defineSatoriTransformer(transformer) {
|
|
19
23
|
return transformer;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { OgImageRenderEventContext, VNode } from '../../../types';
|
|
1
|
+
import type { OgImageRenderEventContext, VNode } from '../../../types.js';
|
|
2
2
|
export declare function createVNodes(ctx: OgImageRenderEventContext): Promise<VNode>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { html as convertHtmlToSatori } from "satori-html";
|
|
2
|
+
import { fetchIsland } from "../../util/kit.js";
|
|
3
|
+
import { htmlDecodeQuotes } from "../../util/encoding.js";
|
|
4
|
+
import { applyInlineCss } from "./transforms/inlineCss.js";
|
|
5
|
+
import { applyEmojis } from "./transforms/emojis.js";
|
|
6
|
+
import { walkSatoriTree } from "./utils.js";
|
|
7
|
+
import unocss from "./plugins/unocss.js";
|
|
8
|
+
import emojis from "./plugins/emojis.js";
|
|
9
|
+
import classes from "./plugins/classes.js";
|
|
10
|
+
import imageSrc from "./plugins/imageSrc.js";
|
|
11
|
+
import flex from "./plugins/flex.js";
|
|
12
|
+
import encoding from "./plugins/encoding.js";
|
|
13
|
+
export async function createVNodes(ctx) {
|
|
14
|
+
let html = ctx.options.html;
|
|
15
|
+
if (!html) {
|
|
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);
|
|
18
|
+
await applyInlineCss(ctx, island);
|
|
19
|
+
await applyEmojis(ctx, island);
|
|
20
|
+
html = island.html;
|
|
21
|
+
if (html?.includes("<body>")) {
|
|
22
|
+
html = html.match(/<body>([\s\S]*)<\/body>/)?.[1] || "";
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
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>`;
|
|
26
|
+
const satoriTree = convertHtmlToSatori(template);
|
|
27
|
+
walkSatoriTree(ctx, satoriTree, [
|
|
28
|
+
emojis,
|
|
29
|
+
classes,
|
|
30
|
+
flex,
|
|
31
|
+
encoding
|
|
32
|
+
]);
|
|
33
|
+
await Promise.all(walkSatoriTree(ctx, satoriTree, [
|
|
34
|
+
unocss,
|
|
35
|
+
imageSrc
|
|
36
|
+
]));
|
|
37
|
+
return satoriTree;
|
|
38
|
+
}
|
|
@@ -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.js";
|
|
5
|
+
import { fetchIsland } from "../../util/kit.js";
|
|
6
|
+
import { applyEmojis } from "../satori/transforms/emojis.js";
|
|
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,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("nitropack
|
|
1
|
+
declare const _default: import("nitropack").NitroAppPlugin;
|
|
2
2
|
export default _default;
|
|
@@ -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.js";
|
|
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,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { parseURL } from "ufo";
|
|
2
|
+
import { defineNitroPlugin } from "nitropack/dist/runtime/plugin";
|
|
3
|
+
import { extractAndNormaliseOgImageOptions, resolvePathCacheKey } from "../og-image/context.js";
|
|
4
|
+
import { prerenderOptionsCache } from "../og-image/cache.js";
|
|
5
|
+
import { isInternalRoute } from "../../pure.js";
|
|
6
|
+
import { createNitroRouteRuleMatcher } from "../util/kit.js";
|
|
7
|
+
export default defineNitroPlugin(async (nitro) => {
|
|
8
|
+
if (!import.meta.prerender)
|
|
9
|
+
return;
|
|
10
|
+
nitro.hooks.hook("render:html", async (html, ctx) => {
|
|
11
|
+
const { head, bodyAppend } = html;
|
|
12
|
+
const path = parseURL(ctx.event.path).pathname;
|
|
13
|
+
if (isInternalRoute(path))
|
|
14
|
+
return;
|
|
15
|
+
const routeRuleMatcher = createNitroRouteRuleMatcher();
|
|
16
|
+
const routeRules = routeRuleMatcher(path);
|
|
17
|
+
if (routeRules.ogImage === false)
|
|
18
|
+
return;
|
|
19
|
+
const options = extractAndNormaliseOgImageOptions([
|
|
20
|
+
head.join("\n"),
|
|
21
|
+
bodyAppend.join("\n")
|
|
22
|
+
].join("\n"));
|
|
23
|
+
if (!options)
|
|
24
|
+
return;
|
|
25
|
+
const key = resolvePathCacheKey(ctx.event);
|
|
26
|
+
await prerenderOptionsCache.setItem(key, options);
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -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;
|
package/dist/runtime/{server/routes/__og-image__/debug.json.mjs → nitro/routes/debug.json.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineEventHandler, setHeader } from "h3";
|
|
2
|
-
import { useOgImageRuntimeConfig } from "
|
|
2
|
+
import { useOgImageRuntimeConfig } from "../../shared.js";
|
|
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 } from "h3";
|
|
1
|
+
import { createError, defineEventHandler, getQuery, proxyRequest, sendRedirect } from "h3";
|
|
2
2
|
import { parseURL } from "ufo";
|
|
3
|
+
import { normaliseFontInput, useOgImageRuntimeConfig } from "../../shared.js";
|
|
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.
|
|
@@ -20,11 +37,11 @@ export default defineEventHandler(async (e) => {
|
|
|
20
37
|
});
|
|
21
38
|
}
|
|
22
39
|
const ttfResource = css.match(/src: url\((.+)\) format\('(opentype|truetype)'\)/);
|
|
23
|
-
if (ttfResource[1])
|
|
24
|
-
return
|
|
40
|
+
if (ttfResource?.[1])
|
|
41
|
+
return proxyRequest(e, ttfResource[1], {});
|
|
25
42
|
const woff2Resource = css.match(/src: url\((.+)\) format\('woff2'\)/);
|
|
26
|
-
if (woff2Resource[1])
|
|
27
|
-
return
|
|
43
|
+
if (woff2Resource?.[1])
|
|
44
|
+
return sendRedirect(e, woff2Resource[1]);
|
|
28
45
|
return createError({
|
|
29
46
|
statusCode: 500,
|
|
30
47
|
statusMessage: `[Nuxt OG Image] Malformed Google Font CSS ${css}`
|
|
@@ -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.js";
|
|
3
|
+
import { useOgImageRuntimeConfig } from "../../shared.js";
|
|
4
|
+
import { resolveContext } from "../og-image/context.js";
|
|
5
|
+
import { html } from "../og-image/templates/html.js";
|
|
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
|
-
import {
|
|
2
|
-
import type { OgImageRenderEventContext } from '
|
|
1
|
+
import type { H3Error } from 'h3';
|
|
2
|
+
import type { OgImageRenderEventContext } from '../../types.js';
|
|
3
3
|
export declare function useOgImageBufferCache(ctx: OgImageRenderEventContext, options: {
|
|
4
4
|
baseCacheKey: string | false;
|
|
5
5
|
cacheMaxAgeSeconds?: number;
|
|
@@ -34,8 +34,9 @@ export async function useOgImageBufferCache(ctx, options) {
|
|
|
34
34
|
modifiedTime: new Date(headers["last-modified"]),
|
|
35
35
|
etag: headers.etag,
|
|
36
36
|
maxAge
|
|
37
|
-
}))
|
|
37
|
+
})) {
|
|
38
38
|
return;
|
|
39
|
+
}
|
|
39
40
|
setHeaders(ctx.e, headers);
|
|
40
41
|
} else {
|
|
41
42
|
await cache.removeItem(key).catch(() => {
|
|
@@ -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(/&#(\d+);/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
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { OgImageOptions } from '../../../types.js';
|
|
2
|
+
declare const _default: import("@vue/runtime-core").DefineComponent<OgImageOptions<"NuxtSeo">, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<OgImageOptions<"NuxtSeo">>, {
|
|
3
|
+
[x: string]: unknown;
|
|
4
|
+
}, {}>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { OgImagePageScreenshotOptions } from '../../../types.js';
|
|
2
|
+
declare const _default: import("@vue/runtime-core").DefineComponent<OgImagePageScreenshotOptions, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<OgImagePageScreenshotOptions>, {
|
|
3
|
+
[x: string]: unknown;
|
|
4
|
+
}, {}>;
|
|
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>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
/**
|
|
3
3
|
* @credits NuxtLabs <https://nuxtlabs.com/>
|
|
4
|
-
* @see https://github.com/nuxt/nuxt.com/blob/main/components/OgImage/
|
|
4
|
+
* @see https://github.com/nuxt/nuxt.com/blob/main/components/OgImage/Docs.vue
|
|
5
5
|
*/
|
|
6
6
|
import { computed } from 'vue'
|
|
7
7
|
|
|
@@ -11,7 +11,8 @@ const props = withDefaults(defineProps<{ title?: string, description?: string, h
|
|
|
11
11
|
headline: 'headline',
|
|
12
12
|
})
|
|
13
13
|
|
|
14
|
-
const title = computed(() => props.title.slice(0, 60))
|
|
14
|
+
const title = computed(() => (props.title || '').slice(0, 60))
|
|
15
|
+
const description = computed(() => (props.description || '').slice(0, 200))
|
|
15
16
|
</script>
|
|
16
17
|
|
|
17
18
|
<template>
|
|
@@ -48,11 +49,11 @@ const title = computed(() => props.title.slice(0, 60))
|
|
|
48
49
|
<p v-if="headline" class="uppercase text-[24px] text-[#00DC82] mb-4 font-semibold">
|
|
49
50
|
{{ headline }}
|
|
50
51
|
</p>
|
|
51
|
-
<h1 class="w-[600px] m-0 text-[75px] font-semibold mb-4 text-white flex items-center">
|
|
52
|
+
<h1 v-if="title" class="w-[600px] m-0 text-[75px] font-semibold mb-4 text-white flex items-center">
|
|
52
53
|
<span>{{ title }}</span>
|
|
53
54
|
</h1>
|
|
54
|
-
<p class="text-[32px] text-[#E4E4E7] leading-tight">
|
|
55
|
-
{{ description
|
|
55
|
+
<p v-if="description" class="text-[32px] text-[#E4E4E7] leading-tight">
|
|
56
|
+
{{ description }}
|
|
56
57
|
</p>
|
|
57
58
|
</div>
|
|
58
59
|
<svg
|
|
@@ -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
|
|
@@ -21,7 +21,7 @@ const props = withDefaults(defineProps<{
|
|
|
21
21
|
title: 'title',
|
|
22
22
|
})
|
|
23
23
|
|
|
24
|
-
const HexRegex = /^#([0-9a-f]{3}){1,2}$/i
|
|
24
|
+
const HexRegex = /^#(?:[0-9a-f]{3}){1,2}$/i
|
|
25
25
|
|
|
26
26
|
const runtimeConfig = useOgImageRuntimeConfig()
|
|
27
27
|
|
|
@@ -78,13 +78,13 @@ const IconComponent = runtimeConfig.hasNuxtIcon
|
|
|
78
78
|
? resolveComponent('Icon')
|
|
79
79
|
: defineComponent({
|
|
80
80
|
render() {
|
|
81
|
-
return h('div', 'missing nuxt
|
|
81
|
+
return h('div', 'missing @nuxt/icon')
|
|
82
82
|
},
|
|
83
83
|
})
|
|
84
84
|
if (typeof props.icon === 'string' && !runtimeConfig.hasNuxtIcon && process.dev) {
|
|
85
|
-
console.warn('Please install
|
|
85
|
+
console.warn('Please install `@nuxt/icon` to use icons with the fallback OG Image component.')
|
|
86
86
|
// eslint-disable-next-line no-console
|
|
87
|
-
console.log('\
|
|
87
|
+
console.log('\nnpx nuxi module add icon\n')
|
|
88
88
|
// create simple div renderer component
|
|
89
89
|
}
|
|
90
90
|
</script>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
/**
|
|
3
3
|
* @credits Pergel <https://nuxtlabs.com/>
|
|
4
|
-
* @see https://github.com/nuxt/nuxt.com/blob/main/components/OgImage/OgImageDocs.vue
|
|
5
4
|
*/
|
|
6
5
|
import { computed } from 'vue'
|
|
7
6
|
|
|
@@ -33,7 +32,7 @@ const title = computed(() => props.title.slice(0, 60))
|
|
|
33
32
|
|
|
34
33
|
<div class="w-[600px] pl-[100px]">
|
|
35
34
|
<p v-if="headline" class="uppercase text-[24px] text-[#FEC476] mb-4 font-semibold">
|
|
36
|
-
|
|
35
|
+
{{ headline }}
|
|
37
36
|
</p>
|
|
38
37
|
<h1 class="w-[600px] m-0 text-[75px] font-semibold mb-4 text-white flex items-center">
|
|
39
38
|
<span>{{ title }}</span>
|
|
@@ -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.js';
|
|
2
2
|
export declare function defineOgImage(_options?: DefineOgImageInput): void;
|