nuxt-og-image 3.0.0-rc.66 → 3.0.0-rc.68
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 +3 -6
- package/dist/client/200.html +179 -179
- package/dist/client/404.html +179 -179
- package/dist/client/_nuxt/{BfBkfEDj.js → 0OCEc-sb.js} +1 -1
- package/dist/client/_nuxt/16nqZaIT.js +1 -0
- package/dist/client/_nuxt/3Ts0ZrM4.js +4 -0
- package/dist/client/_nuxt/44JOqR_V.js +1 -0
- package/dist/client/_nuxt/4FkZXfg1.js +3 -0
- package/dist/client/_nuxt/{DoY4Dbtn.js → 4WleZr1P.js} +1 -1
- package/dist/client/_nuxt/5HixFuyr.js +1 -0
- package/dist/client/_nuxt/{C31OBGbl.js → 5bRVBCrv.js} +1 -1
- package/dist/client/_nuxt/{DanM9F4-.js → 7LPQ6a13.js} +2 -2
- package/dist/client/_nuxt/8WiSp-0_.js +1 -0
- package/dist/client/_nuxt/9CfBjzQa.js +1 -0
- package/dist/client/_nuxt/B-9EjyZr.js +1 -0
- package/dist/client/_nuxt/B-a2BbyY.js +1 -0
- package/dist/client/_nuxt/B0LoMq2b.js +1 -0
- package/dist/client/_nuxt/{BSSAUge4.js → B1ejXUAS.js} +1 -1
- package/dist/client/_nuxt/{DhldU3XI.js → B3LRAdDP.js} +1 -1
- package/dist/client/_nuxt/B7-FEXAT.js +1 -0
- package/dist/client/_nuxt/B9HI_aQy.js +1 -0
- package/dist/client/_nuxt/{D85lwgPO.js → B9vFkdfw.js} +1 -1
- package/dist/client/_nuxt/BAGvEKUB.js +1 -0
- package/dist/client/_nuxt/BAp2aEeE.js +1 -0
- package/dist/client/_nuxt/{C3NvtN4M.js → BB9S_66N.js} +1 -1
- package/dist/client/_nuxt/{AoxqhCl0.js → BCOu96sC.js} +1 -1
- package/dist/client/_nuxt/BGk6HrHT.js +1 -0
- package/dist/client/_nuxt/BHSTd-7M.js +1 -0
- package/dist/client/_nuxt/BKFBoKT4.js +1 -0
- package/dist/client/_nuxt/BKNiEhql.js +1 -0
- package/dist/client/_nuxt/BNgG76gt.js +1 -0
- package/dist/client/_nuxt/{BbPU79SD.js → BNofkYSZ.js} +14 -14
- package/dist/client/_nuxt/BOp3HRET.js +1 -0
- package/dist/client/_nuxt/{DaDGU6kf.js → BQnHL-cn.js} +1 -1
- package/dist/client/_nuxt/BS9sT-GQ.js +1 -0
- package/dist/client/_nuxt/BU83OF-G.js +1 -0
- package/dist/client/_nuxt/BUeIC4cT.js +1 -0
- package/dist/client/_nuxt/BXUVD3TH.js +1 -0
- package/dist/client/_nuxt/BXWtGw2n.js +6 -0
- package/dist/client/_nuxt/{VVtMly4c.js → BYLuaE_S.js} +1 -1
- package/dist/client/_nuxt/{C46DigdT.js → Ba_2pva2.js} +1 -1
- package/dist/client/_nuxt/BeX7BQ1y.js +1 -0
- package/dist/client/_nuxt/{ChVe37jp.js → BfVRrWqI.js} +1 -1
- package/dist/client/_nuxt/BgEvnnZj.js +1 -0
- package/dist/client/_nuxt/{BEPTDMGr.js → Bgrlo6mM.js} +1 -1
- package/dist/client/_nuxt/{CBoehFVA.js → Bl6w8nq6.js} +2 -2
- package/dist/client/_nuxt/BmUjtHPt.js +1 -0
- package/dist/client/_nuxt/BnYPtiAB.js +1 -0
- package/dist/client/_nuxt/{B9S9BZZh.js → BotTw_1M.js} +1 -1
- package/dist/client/_nuxt/BpqPLH6b.js +1 -0
- package/dist/client/_nuxt/{DT2db06B.js → Br4herk8.js} +1 -1
- package/dist/client/_nuxt/Brmco9EZ.js +2 -0
- package/dist/client/_nuxt/{BiU8-mv6.js → Bs9WCFOo.js} +1 -1
- package/dist/client/_nuxt/BtPWTO6-.js +1 -0
- package/dist/client/_nuxt/BwUg_Rem.js +1 -0
- package/dist/client/_nuxt/Bxuka25Y.js +1 -0
- package/dist/client/_nuxt/{Bcn1f5Rp.js → BxwkrKyP.js} +1 -1
- package/dist/client/_nuxt/{D9s3Eyz8.js → ByN1NmdT.js} +2 -2
- package/dist/client/_nuxt/C2Z2wNnw.js +1 -0
- package/dist/client/_nuxt/{DGTPbQyx.js → C3wf4cjV.js} +1 -1
- package/dist/client/_nuxt/{16u1w-DC.js → C5J_9lw5.js} +1 -1
- package/dist/client/_nuxt/C6doOGgB.js +1 -0
- package/dist/client/_nuxt/{BY8_eel9.js → C7xspq5a.js} +1 -1
- package/dist/client/_nuxt/C9CNr0dZ.js +1 -0
- package/dist/client/_nuxt/CA2blNRc.js +1 -0
- package/dist/client/_nuxt/{DFQMbhFG.js → CCW61mLD.js} +1 -1
- package/dist/client/_nuxt/{DOt8O2FJ.js → CDP-pALJ.js} +1 -1
- package/dist/client/_nuxt/{LrshOcZ2.js → CFy8Z7mU.js} +1 -1
- package/dist/client/_nuxt/CHDuk4cg.js +1 -0
- package/dist/client/_nuxt/{B5v32tNS.js → CKK8qrH7.js} +2 -2
- package/dist/client/_nuxt/CKqhLkpw.js +1 -0
- package/dist/client/_nuxt/{MJ0gDQnJ.js → CLTURUqp.js} +3 -3
- package/dist/client/_nuxt/CPQn-Lhb.js +1 -0
- package/dist/client/_nuxt/CRUEGcu5.js +1 -0
- package/dist/client/_nuxt/{CT9A9Qiu.js → CS6sTstm.js} +1 -1
- package/dist/client/_nuxt/{DWE3vCE5.js → CSPPpfsQ.js} +1 -1
- package/dist/client/_nuxt/CTeQKLZv.js +1 -0
- package/dist/client/_nuxt/CTsPJjdJ.js +1 -0
- package/dist/client/_nuxt/{A4Fa72hX.js → CUNQUWO_.js} +1 -1
- package/dist/client/_nuxt/CV5B5C80.js +1 -0
- package/dist/client/_nuxt/CZkFsSlX.js +1 -0
- package/dist/client/_nuxt/{8R90CSQj.js → C_h5G2He.js} +1 -1
- package/dist/client/_nuxt/{B5--Xptx.js → CaR_I2C-.js} +1 -1
- package/dist/client/_nuxt/Cb48SAmt.js +1 -0
- package/dist/client/_nuxt/{nc-bU77P.js → CeIpHJfZ.js} +3 -3
- package/dist/client/_nuxt/{coyhVBVA.js → ClPxYbPx.js} +1 -1
- package/dist/client/_nuxt/Clj_IpB8.js +1 -0
- package/dist/client/_nuxt/CmN1UzhW.js +1 -0
- package/dist/client/_nuxt/CvHWZNAB.js +1 -0
- package/dist/client/_nuxt/CyUS7F7b.js +17 -0
- package/dist/client/_nuxt/{D4LJwL2b.js → Cz-n9WvF.js} +1 -1
- package/dist/client/_nuxt/{CDzo4tzE.js → Cz3ygVR-.js} +1 -1
- package/dist/client/_nuxt/{CEuqc8ZQ.js → CzK8D06Z.js} +1 -1
- package/dist/client/_nuxt/{CXYaz1c9.js → D0N_qbs7.js} +1 -1
- package/dist/client/_nuxt/D0pnavP-.js +1 -0
- package/dist/client/_nuxt/D25Gr2Wc.js +1 -0
- package/dist/client/_nuxt/D4miJ1xw.js +1 -0
- package/dist/client/_nuxt/D6oCKXcX.js +1 -0
- package/dist/client/_nuxt/DBLgxP_1.js +2 -0
- package/dist/client/_nuxt/{ByMv4Xf1.js → DCmDdbvy.js} +1 -1
- package/dist/client/_nuxt/{zt9m_cFA.js → DDG_rSGg.js} +1 -1
- package/dist/client/_nuxt/DFHN_7lU.js +3 -0
- package/dist/client/_nuxt/DFsxFixh.js +1 -0
- package/dist/client/_nuxt/DGhhRy1e.js +1 -0
- package/dist/client/_nuxt/{DdacRhvC.js → DIw1DfnK.js} +1 -1
- package/dist/client/_nuxt/DJNHLfzP.js +1 -0
- package/dist/client/_nuxt/{XP2_9bVu.js → DJOPMAPO.js} +1 -1
- package/dist/client/_nuxt/DO04iIl4.js +1 -0
- package/dist/client/_nuxt/DOOuMSMh.js +1 -0
- package/dist/client/_nuxt/DRuVOcqL.js +1 -0
- package/dist/client/_nuxt/{B2Zkg-Ae.js → DSv7Jr7N.js} +2 -2
- package/dist/client/_nuxt/DTMFIK7w.js +1 -0
- package/dist/client/_nuxt/{6XBPEST2.js → DXdsTRaC.js} +1 -1
- package/dist/client/_nuxt/{DgraCSOE.js → DXtfa3TF.js} +1 -1
- package/dist/client/_nuxt/{iYrPSY0y.js → DYgwfmdY.js} +1 -1
- package/dist/client/_nuxt/DYikCEmq.js +1 -0
- package/dist/client/_nuxt/{D6SwP_ef.js → DYrknm32.js} +1 -1
- package/dist/client/_nuxt/D_lsq3cR.js +1 -0
- package/dist/client/_nuxt/{4JG6XROL.js → Dc3u8CCo.js} +1 -1
- package/dist/client/_nuxt/Df4vQnuo.js +1 -0
- package/dist/client/_nuxt/Di1G_BEd.js +1 -0
- package/dist/client/_nuxt/Dk2kDqHs.js +1 -0
- package/dist/client/_nuxt/DkIL16gc.js +2 -0
- package/dist/client/_nuxt/DmixpzPA.js +1 -0
- package/dist/client/_nuxt/{CkoJTUbt.js → Dnd6U92I.js} +1 -1
- package/dist/client/_nuxt/DofIr7ih.js +1 -0
- package/dist/client/_nuxt/DqFtmHIk.js +1 -0
- package/dist/client/_nuxt/{DLpTrZod.js → DrUHIbQf.js} +1 -1
- package/dist/client/_nuxt/{CJ21IjBY.js → DrhOmAGa.js} +1 -1
- package/dist/client/_nuxt/{DmAvib0Y.js → DsO5WfEU.js} +1 -1
- package/dist/client/_nuxt/{CIlkkgNU.js → DsclqnHy.js} +1 -1
- package/dist/client/_nuxt/Dwk9V841.js +1 -0
- package/dist/client/_nuxt/DyLIn2qo.js +1 -0
- package/dist/client/_nuxt/{C9d3aiqh.js → DzhYcJWo.js} +1 -1
- package/dist/client/_nuxt/{DxX6t7GH.js → Dziqk49f.js} +1 -1
- package/dist/client/_nuxt/{DqvgqZmm.js → E5r7Moxb.js} +1 -1
- package/dist/client/_nuxt/{B_SUYfiV.js → FMRyFT8D.js} +1 -1
- package/dist/client/_nuxt/{TDVTyJvX.js → GACPk8cj.js} +1 -1
- package/dist/client/_nuxt/H94RPpLS.js +1 -0
- package/dist/client/_nuxt/{DBxHOdLe.js → HxmVvryO.js} +1 -1
- package/dist/client/_nuxt/JYC31MTV.js +1 -0
- package/dist/client/_nuxt/Jl0QvYgb.js +1 -0
- package/dist/client/_nuxt/{C17JnZbq.js → KA8c-whL.js} +1 -1
- package/dist/client/_nuxt/Ka_J5llu.js +1 -0
- package/dist/client/_nuxt/KuNYkU7X.js +1 -0
- package/dist/client/_nuxt/MkuNFWFs.js +204 -0
- package/dist/client/_nuxt/{BaedD2tq.js → N3zwmhmW.js} +1 -1
- package/dist/client/_nuxt/O4cDyHwR.js +1 -0
- package/dist/client/_nuxt/OPd3ySAa.js +1 -0
- package/dist/client/_nuxt/{BqpV9M7Y.js → Opso89zU.js} +1 -1
- package/dist/client/_nuxt/{CV8JdvfZ.js → PauOf_jS.js} +1 -1
- package/dist/client/_nuxt/Qj0mFepl.js +14 -0
- package/dist/client/_nuxt/R9SNgiQ9.js +1 -0
- package/dist/client/_nuxt/{C6XIsc4F.js → Rc0-bMtX.js} +1 -1
- package/dist/client/_nuxt/{CKpfY2P2.js → TYaudu4O.js} +1 -1
- package/dist/client/_nuxt/VRCUJX8G.js +1 -0
- package/dist/client/_nuxt/{CMiaevpY.js → Ys9ZunwU.js} +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/353519f1-2e76-4016-9b50-2f26f3cb8794.json +1 -0
- package/dist/client/_nuxt/{CD1ynQRS.js → eJKZXzCK.js} +1 -1
- package/dist/client/_nuxt/{PSVKygaU.js → eQYbbmqd.js} +1 -1
- package/dist/client/_nuxt/{entry.cOhDjBNG.css → entry.DtsycVcr.css} +1 -1
- package/dist/client/_nuxt/error-404.CUF_CFKB.css +1 -0
- package/dist/client/_nuxt/error-500.BR60owpQ.css +1 -0
- package/dist/client/_nuxt/i0hkWYmE.js +1 -0
- package/dist/client/_nuxt/{ByGMIDPY.js → ithPx4uF.js} +1 -1
- package/dist/client/_nuxt/{I-_ljZ1M.js → jDrCW69G.js} +1 -1
- package/dist/client/_nuxt/kveMaAK5.js +1 -0
- package/dist/client/_nuxt/lBoe4CZw.js +1 -0
- package/dist/client/_nuxt/{DoQu802G.js → lPxKsdjn.js} +1 -1
- package/dist/client/_nuxt/lRZxrFTT.js +1 -0
- package/dist/client/_nuxt/mvTh5Gok.js +1 -0
- package/dist/client/_nuxt/pCnzZaOt.js +1 -0
- package/dist/client/_nuxt/qpF8edk8.js +1 -0
- package/dist/client/_nuxt/qvnQm5y7.js +1 -0
- package/dist/client/_nuxt/qwoaayiL.js +1 -0
- package/dist/client/_nuxt/t1S7pxBA.js +1 -0
- package/dist/client/_nuxt/t6MJYFCU.js +5 -0
- package/dist/client/_nuxt/tEd5xQ4M.js +1 -0
- package/dist/client/_nuxt/{DZwJH60W.js → xGgVA17b.js} +1 -1
- package/dist/client/_nuxt/yvfKceIB.js +1 -0
- package/dist/client/_nuxt/{E1IWMS2c.js → z5DqfkHR.js} +1 -1
- package/dist/client/index.html +179 -179
- package/dist/module.d.mts +5 -1
- package/dist/module.d.ts +5 -1
- package/dist/module.json +2 -2
- package/dist/module.mjs +246 -131
- package/dist/runtime/nitro/og-image/bindings/chromium/chrome-launcher.js +1 -1
- package/dist/runtime/nitro/og-image/bindings/chromium/on-demand.js +1 -1
- package/dist/runtime/nitro/og-image/bindings/satori/wasm.js +1 -1
- package/dist/runtime/nitro/og-image/{cache.d.ts → cache/lru.d.ts} +3 -1
- package/dist/runtime/nitro/og-image/{cache.js → cache/lru.js} +6 -0
- package/dist/runtime/nitro/og-image/cache/mock.d.ts +9 -0
- package/dist/runtime/nitro/og-image/cache/mock.js +9 -0
- package/dist/runtime/nitro/og-image/chromium/renderer.js +1 -1
- package/dist/runtime/nitro/og-image/chromium/screenshot.js +1 -1
- package/dist/runtime/nitro/og-image/context.js +8 -8
- package/dist/runtime/nitro/og-image/satori/font.d.ts +1 -0
- package/dist/runtime/nitro/og-image/satori/font.js +2 -2
- package/dist/runtime/nitro/og-image/satori/instances.d.ts +1 -1
- package/dist/runtime/nitro/og-image/satori/plugins/encoding.js +1 -1
- package/dist/runtime/nitro/og-image/satori/plugins/flex.js +27 -2
- package/dist/runtime/nitro/og-image/satori/plugins/imageSrc.js +3 -3
- package/dist/runtime/nitro/og-image/satori/plugins/unocss.js +1 -1
- package/dist/runtime/nitro/og-image/satori/renderer.js +3 -7
- package/dist/runtime/nitro/og-image/satori/transforms/emojis.d.ts +0 -2
- package/dist/runtime/nitro/og-image/satori/transforms/emojis.js +1 -5
- package/dist/runtime/nitro/og-image/satori/transforms/inlineCss.js +1 -1
- package/dist/runtime/nitro/og-image/satori/vnodes.js +8 -8
- package/dist/runtime/nitro/og-image/templates/html.js +16 -21
- package/dist/runtime/nitro/plugins/__zero-runtime/nuxt-content.d.ts +2 -0
- package/dist/runtime/nitro/plugins/__zero-runtime/nuxt-content.js +9 -0
- package/dist/runtime/nitro/plugins/nuxt-content.js +2 -52
- package/dist/runtime/nitro/plugins/prerender.js +9 -4
- package/dist/runtime/nitro/routes/__zero-runtime/font.d.ts +2 -0
- package/dist/runtime/nitro/routes/__zero-runtime/font.js +8 -0
- package/dist/runtime/nitro/routes/__zero-runtime/image.d.ts +2 -0
- package/dist/runtime/nitro/routes/__zero-runtime/image.js +8 -0
- package/dist/runtime/nitro/routes/debug.json.js +2 -2
- package/dist/runtime/nitro/routes/font.js +3 -49
- package/dist/runtime/nitro/routes/image.js +3 -87
- package/dist/runtime/nitro/util/cache.js +3 -3
- package/dist/runtime/nitro/util/eventHandlers.d.ts +3 -0
- package/dist/runtime/nitro/util/eventHandlers.js +155 -0
- package/dist/runtime/nitro/util/kit.d.ts +1 -1
- package/dist/runtime/nitro/util/kit.js +3 -3
- package/dist/runtime/nitro/util/plugins.d.ts +2 -0
- package/dist/runtime/nitro/util/plugins.js +54 -0
- package/dist/runtime/nuxt/components/OgImage/OgImage.d.ts +1 -3
- package/dist/runtime/nuxt/components/OgImage/OgImage.js +1 -1
- package/dist/runtime/nuxt/components/OgImage/OgImageScreenshot.d.ts +1 -3
- package/dist/runtime/nuxt/components/OgImage/OgImageScreenshot.js +1 -1
- package/dist/runtime/nuxt/components/Templates/Community/NuxtSeo.vue +2 -2
- package/dist/runtime/nuxt/components/Templates/Community/SimpleBlog.vue +1 -1
- package/dist/runtime/nuxt/composables/defineOgImage.js +7 -5
- package/dist/runtime/nuxt/composables/defineOgImageComponent.d.ts +1 -1
- package/dist/runtime/nuxt/composables/mock.d.ts +1 -1
- package/dist/runtime/nuxt/plugins/__zero-runtime/og-image-canonical-urls.server.d.ts +2 -0
- package/dist/runtime/nuxt/plugins/__zero-runtime/og-image-canonical-urls.server.js +9 -0
- package/dist/runtime/nuxt/plugins/__zero-runtime/route-rule-og-image.server.d.ts +2 -0
- package/dist/runtime/nuxt/plugins/__zero-runtime/route-rule-og-image.server.js +9 -0
- package/dist/runtime/nuxt/plugins/og-image-canonical-urls.server.js +3 -51
- package/dist/runtime/nuxt/plugins/route-rule-og-image.server.js +4 -36
- package/dist/runtime/nuxt/utils/plugins.d.ts +3 -0
- package/dist/runtime/nuxt/utils/plugins.js +87 -0
- package/dist/runtime/nuxt/utils.js +6 -4
- package/dist/runtime/shared.js +3 -3
- package/dist/runtime/types.d.ts +6 -5
- package/dist/types.d.mts +0 -4
- package/dist/types.d.ts +0 -4
- package/package.json +31 -23
- package/dist/client/_nuxt/6bkCFmAg.js +0 -1
- package/dist/client/_nuxt/B3yJX9Qu.js +0 -1
- package/dist/client/_nuxt/B5USdwzW.js +0 -1
- package/dist/client/_nuxt/B7zm8LFH.js +0 -2
- package/dist/client/_nuxt/B8yeR86s.js +0 -1
- package/dist/client/_nuxt/B9MAV_WH.js +0 -1
- package/dist/client/_nuxt/B9afuS00.js +0 -1
- package/dist/client/_nuxt/BDUkJJFZ.js +0 -1
- package/dist/client/_nuxt/BEIEqD7s.js +0 -1
- package/dist/client/_nuxt/BESheOyt.js +0 -1
- package/dist/client/_nuxt/BFO9THtE.js +0 -1
- package/dist/client/_nuxt/BICcMyTi.js +0 -1
- package/dist/client/_nuxt/BIboXAcp.js +0 -1
- package/dist/client/_nuxt/BNuYtHxo.js +0 -1
- package/dist/client/_nuxt/BOCDpWc1.js +0 -17
- package/dist/client/_nuxt/BOtZLFcM.js +0 -3
- package/dist/client/_nuxt/BPiaQZfK.js +0 -1
- package/dist/client/_nuxt/BQgbS7Yt.js +0 -1
- package/dist/client/_nuxt/BSrQBeSJ.js +0 -131
- package/dist/client/_nuxt/BTO_K1fm.js +0 -1
- package/dist/client/_nuxt/BUQ2FcJX.js +0 -1
- package/dist/client/_nuxt/BVsCzzYp.js +0 -1
- package/dist/client/_nuxt/BccEf5hb.js +0 -1
- package/dist/client/_nuxt/BeqgMazi.js +0 -1
- package/dist/client/_nuxt/BltGI4TE.js +0 -1
- package/dist/client/_nuxt/BrHEiNXv.js +0 -1
- package/dist/client/_nuxt/BspO9hSn.js +0 -1
- package/dist/client/_nuxt/Bszlo9K_.js +0 -1
- package/dist/client/_nuxt/Bt3jdO27.js +0 -1
- package/dist/client/_nuxt/BzeF2RWN.js +0 -1
- package/dist/client/_nuxt/C5QX-GgJ.js +0 -1
- package/dist/client/_nuxt/C6F4YvHi.js +0 -1
- package/dist/client/_nuxt/C6pBAdyX.js +0 -1
- package/dist/client/_nuxt/C7O_L2NY.js +0 -1
- package/dist/client/_nuxt/C8KGJGmD.js +0 -1
- package/dist/client/_nuxt/C9X_x5J1.js +0 -1
- package/dist/client/_nuxt/CAkjjYd_.js +0 -1
- package/dist/client/_nuxt/CDLXdqou.js +0 -6
- package/dist/client/_nuxt/CTjLfFPV.js +0 -1
- package/dist/client/_nuxt/CY-WakqA.js +0 -1
- package/dist/client/_nuxt/C_D4IvTY.js +0 -1
- package/dist/client/_nuxt/CbFpZgCV.js +0 -1
- package/dist/client/_nuxt/CbjS_D4a.js +0 -1
- package/dist/client/_nuxt/CeUooOMz.js +0 -1
- package/dist/client/_nuxt/Clnf9f06.js +0 -1
- package/dist/client/_nuxt/CmHkUvIV.js +0 -1
- package/dist/client/_nuxt/CmonagEV.js +0 -1
- package/dist/client/_nuxt/CowR2XfX.js +0 -1
- package/dist/client/_nuxt/CuJfdYLG.js +0 -1
- package/dist/client/_nuxt/CwZIVF5c.js +0 -1
- package/dist/client/_nuxt/Cwv93qcC.js +0 -4
- package/dist/client/_nuxt/CzrtbdtR.js +0 -1
- package/dist/client/_nuxt/D1i8Vxii.js +0 -1
- package/dist/client/_nuxt/D384ylkT.js +0 -1
- package/dist/client/_nuxt/D7Nx8OLD.js +0 -1
- package/dist/client/_nuxt/D8YTaFMU.js +0 -1
- package/dist/client/_nuxt/D8ecWW_g.js +0 -1
- package/dist/client/_nuxt/DA288kE2.js +0 -3
- package/dist/client/_nuxt/DAVo6uMX.js +0 -1
- package/dist/client/_nuxt/DFRYOy8B.js +0 -1
- package/dist/client/_nuxt/DHCC4-m4.js +0 -1
- package/dist/client/_nuxt/DIC-ECB_.js +0 -1
- package/dist/client/_nuxt/DKluMpTE.js +0 -1
- package/dist/client/_nuxt/DKrjeWrU.js +0 -1
- package/dist/client/_nuxt/DOwv4Xrr.js +0 -1
- package/dist/client/_nuxt/DQdnirlo.js +0 -1
- package/dist/client/_nuxt/DRgydeCt.js +0 -1
- package/dist/client/_nuxt/DS9ZWoKD.js +0 -1
- package/dist/client/_nuxt/DSPtUMMI.js +0 -1
- package/dist/client/_nuxt/DYQagCV4.js +0 -1
- package/dist/client/_nuxt/DfqM7apN.js +0 -1
- package/dist/client/_nuxt/Dm9yFT8Y.js +0 -2
- package/dist/client/_nuxt/DoDCNZ2x.js +0 -1
- package/dist/client/_nuxt/Dtv2yyrc.js +0 -1
- package/dist/client/_nuxt/DvreHBtf.js +0 -1
- package/dist/client/_nuxt/DvyTQcux.js +0 -1
- package/dist/client/_nuxt/H2A8RXvM.js +0 -1
- package/dist/client/_nuxt/KCgU82S2.js +0 -1
- package/dist/client/_nuxt/NboNzovp.js +0 -1
- package/dist/client/_nuxt/PYrcYqZ1.js +0 -1
- package/dist/client/_nuxt/SXuYmi6B.js +0 -1
- package/dist/client/_nuxt/Sm_sVxcW.js +0 -14
- package/dist/client/_nuxt/Wkyh6-uf.js +0 -1
- package/dist/client/_nuxt/XrZDCB4K.js +0 -1
- package/dist/client/_nuxt/_fwBhpzY.js +0 -1
- package/dist/client/_nuxt/a0z0KVy-.js +0 -5
- package/dist/client/_nuxt/bPMpiWut.js +0 -1
- package/dist/client/_nuxt/builds/meta/517cb958-776a-47e2-bd34-69240f18e412.json +0 -1
- package/dist/client/_nuxt/d2PdAb0u.js +0 -2
- package/dist/client/_nuxt/error-404.F6YJ8FEX.css +0 -1
- package/dist/client/_nuxt/error-500.TGideFTg.css +0 -1
- package/dist/client/_nuxt/g4vhSHS2.js +0 -1
- package/dist/client/_nuxt/kZiYIjIU.js +0 -1
- package/dist/client/_nuxt/lOwNZ7_V.js +0 -1
- package/dist/client/_nuxt/nfCtBF4F.js +0 -1
- package/dist/client/_nuxt/pit2X7C0.js +0 -1
- package/dist/client/_nuxt/r5D-aIjp.js +0 -1
- package/dist/client/_nuxt/rh45RTDP.js +0 -1
- package/dist/client/_nuxt/tgs8ujlj.js +0 -1
- package/dist/client/_nuxt/v_4dTNAb.js +0 -1
- package/dist/client/_nuxt/vvK2q8Zt.js +0 -1
- package/dist/client/_nuxt/yOCz8xPT.js +0 -1
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { createError, getQuery, H3Error, proxyRequest, sendRedirect, setHeader, setResponseHeader } from "h3";
|
|
2
|
+
import { parseURL } from "ufo";
|
|
3
|
+
import { normaliseFontInput, useOgImageRuntimeConfig } from "../../shared.js";
|
|
4
|
+
import { resolveContext } from "../og-image/context.js";
|
|
5
|
+
import { assets } from "../og-image/satori/font.js";
|
|
6
|
+
import { html } from "../og-image/templates/html.js";
|
|
7
|
+
import { useOgImageBufferCache } from "./cache.js";
|
|
8
|
+
export async function fontEventHandler(e) {
|
|
9
|
+
const path = parseURL(e.path).pathname;
|
|
10
|
+
const { fonts } = useOgImageRuntimeConfig();
|
|
11
|
+
const key = path.split("/font/")[1];
|
|
12
|
+
if (key.includes(":")) {
|
|
13
|
+
const font2 = fonts.find((f) => f.key === key);
|
|
14
|
+
if (font2?.key && await assets.hasItem(font2.key)) {
|
|
15
|
+
let fontData = await assets.getItem(font2.key);
|
|
16
|
+
if (fontData instanceof Uint8Array) {
|
|
17
|
+
const decoder = new TextDecoder();
|
|
18
|
+
fontData = decoder.decode(fontData);
|
|
19
|
+
}
|
|
20
|
+
if (key.includes(".oft")) {
|
|
21
|
+
setResponseHeader(e, "Content-Type", "font/otf");
|
|
22
|
+
} else if (key.includes(".woff2")) {
|
|
23
|
+
setResponseHeader(e, "Content-Type", "font/woff2");
|
|
24
|
+
} else if (key.includes(".ttf")) {
|
|
25
|
+
setResponseHeader(e, "Content-Type", "font/ttf");
|
|
26
|
+
}
|
|
27
|
+
return Buffer.from(fontData, "base64");
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const [_name, _weight] = key.split(".")[0].split("/");
|
|
31
|
+
if (!_name || !_weight)
|
|
32
|
+
return "Provide a font name and weight";
|
|
33
|
+
const name = _name[0].toUpperCase() + _name.slice(1);
|
|
34
|
+
const weight = Math.round(Number.parseInt(_weight) / 100) * 100;
|
|
35
|
+
const config = useOgImageRuntimeConfig();
|
|
36
|
+
const normalisedFonts = normaliseFontInput(config.fonts);
|
|
37
|
+
let font;
|
|
38
|
+
if (typeof getQuery(e).font === "string")
|
|
39
|
+
font = JSON.parse(getQuery(e).font);
|
|
40
|
+
if (!font) {
|
|
41
|
+
font = normalisedFonts.find((font2) => {
|
|
42
|
+
return font2.name.toLowerCase() === name.toLowerCase() && weight === Number(font2.weight);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
if (!font) {
|
|
46
|
+
return createError({
|
|
47
|
+
statusCode: 404,
|
|
48
|
+
statusMessage: `[Nuxt OG Image] Font ${name}:${weight} not found`
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
const css = await globalThis.$fetch(`https://fonts.googleapis.com/css2?family=${name}:wght@${weight}`, {
|
|
52
|
+
headers: {
|
|
53
|
+
// Make sure it returns TTF.
|
|
54
|
+
"User-Agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; de-at) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1"
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
if (!css) {
|
|
58
|
+
return createError({
|
|
59
|
+
statusCode: 500,
|
|
60
|
+
statusMessage: `[Nuxt OG Image] Invalid Google Font ${name}:${weight}`
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
const ttfResource = css.match(/src: url\((.+)\) format\('(opentype|truetype)'\)/);
|
|
64
|
+
if (ttfResource?.[1])
|
|
65
|
+
return proxyRequest(e, ttfResource[1], {});
|
|
66
|
+
const woff2Resource = css.match(/src: url\((.+)\) format\('woff2'\)/);
|
|
67
|
+
if (woff2Resource?.[1])
|
|
68
|
+
return sendRedirect(e, woff2Resource[1]);
|
|
69
|
+
return createError({
|
|
70
|
+
statusCode: 500,
|
|
71
|
+
statusMessage: `[Nuxt OG Image] Malformed Google Font CSS ${css}`
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
export async function imageEventHandler(e) {
|
|
75
|
+
const ctx = await resolveContext(e);
|
|
76
|
+
if (ctx instanceof H3Error)
|
|
77
|
+
return ctx;
|
|
78
|
+
const { isDebugJsonPayload, extension, options, renderer } = ctx;
|
|
79
|
+
const { debug, baseCacheKey } = useOgImageRuntimeConfig();
|
|
80
|
+
const compatibilityHints = [];
|
|
81
|
+
if (isDebugJsonPayload) {
|
|
82
|
+
const queryExtension = getQuery(e).extension || ctx.options.extension;
|
|
83
|
+
if (["jpeg", "jpg"].includes(queryExtension) && options.renderer === "satori")
|
|
84
|
+
compatibilityHints.push("Converting PNGs to JPEGs requires Sharp which only runs on Node based systems.");
|
|
85
|
+
if (options.renderer === "chromium")
|
|
86
|
+
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");
|
|
87
|
+
setHeader(e, "Content-Type", "application/json");
|
|
88
|
+
return {
|
|
89
|
+
siteConfig: {
|
|
90
|
+
url: e.context.siteConfig.get().url
|
|
91
|
+
},
|
|
92
|
+
compatibilityHints,
|
|
93
|
+
cacheKey: ctx.key,
|
|
94
|
+
options: ctx.options,
|
|
95
|
+
...options.renderer === "satori" ? await renderer.debug(ctx) : void 0
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
switch (extension) {
|
|
99
|
+
case "html":
|
|
100
|
+
setHeader(e, "Content-Type", `text/html`);
|
|
101
|
+
return html(ctx);
|
|
102
|
+
case "svg":
|
|
103
|
+
if (!debug && !import.meta.dev) {
|
|
104
|
+
return createError({
|
|
105
|
+
statusCode: 404
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
if (ctx.renderer.name !== "satori") {
|
|
109
|
+
return createError({
|
|
110
|
+
statusCode: 400,
|
|
111
|
+
statusMessage: `[Nuxt OG Image] Generating ${extension}'s with ${renderer.name} is not supported.`
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
setHeader(e, "Content-Type", `image/svg+xml`);
|
|
115
|
+
return (await ctx.renderer.debug(ctx)).svg;
|
|
116
|
+
case "png":
|
|
117
|
+
case "jpeg":
|
|
118
|
+
case "jpg":
|
|
119
|
+
if (!renderer.supportedFormats.includes(extension)) {
|
|
120
|
+
return createError({
|
|
121
|
+
statusCode: 400,
|
|
122
|
+
statusMessage: `[Nuxt OG Image] Generating ${extension}'s with ${renderer.name} is not supported.`
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
setHeader(e, "Content-Type", `image/${extension === "jpg" ? "jpeg" : extension}`);
|
|
126
|
+
break;
|
|
127
|
+
default:
|
|
128
|
+
return createError({
|
|
129
|
+
statusCode: 400,
|
|
130
|
+
statusMessage: `[Nuxt OG Image] Invalid request for og.${extension}.`
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
const cacheApi = await useOgImageBufferCache(ctx, {
|
|
134
|
+
cacheMaxAgeSeconds: ctx.options.cacheMaxAgeSeconds,
|
|
135
|
+
baseCacheKey
|
|
136
|
+
});
|
|
137
|
+
if (typeof cacheApi === "undefined")
|
|
138
|
+
return;
|
|
139
|
+
if (cacheApi instanceof H3Error)
|
|
140
|
+
return cacheApi;
|
|
141
|
+
let image = cacheApi.cachedItem;
|
|
142
|
+
if (!image) {
|
|
143
|
+
image = await renderer.createImage(ctx);
|
|
144
|
+
if (image instanceof H3Error)
|
|
145
|
+
return image;
|
|
146
|
+
if (!image) {
|
|
147
|
+
return createError({
|
|
148
|
+
statusCode: 500,
|
|
149
|
+
statusMessage: `Failed to generate og.${extension}.`
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
await cacheApi.update(image);
|
|
153
|
+
}
|
|
154
|
+
return image;
|
|
155
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { NitroRouteRules } from 'nitropack';
|
|
2
1
|
import type { H3Event } from 'h3';
|
|
2
|
+
import type { NitroRouteRules } from 'nitropack';
|
|
3
3
|
import type { NuxtIslandResponse } from 'nuxt/dist/core/runtime/nitro/renderer';
|
|
4
4
|
export declare function fetchIsland(e: H3Event, component: string, props: Record<string, any>): Promise<NuxtIslandResponse>;
|
|
5
5
|
export declare function withoutQuery(path: string): string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useRuntimeConfig } from "#imports";
|
|
2
2
|
import { defu } from "defu";
|
|
3
|
-
import { withoutBase, withoutTrailingSlash } from "ufo";
|
|
4
3
|
import { hash } from "ohash";
|
|
5
|
-
import {
|
|
4
|
+
import { createRouter as createRadixRouter, toRouteMatcher } from "radix3";
|
|
5
|
+
import { withoutBase, withoutTrailingSlash } from "ufo";
|
|
6
6
|
export function fetchIsland(e, component, props) {
|
|
7
7
|
const hashId = hash([component, props]);
|
|
8
8
|
return e.$fetch(`/__nuxt_island/${component}_${hashId}.json`, {
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { defu } from "defu";
|
|
2
|
+
import { stringify } from "devalue";
|
|
3
|
+
import { getOgImagePath, useOgImageRuntimeConfig } from "../../shared.js";
|
|
4
|
+
export function nuxtContentPlugin(nitroApp) {
|
|
5
|
+
const { isNuxtContentDocumentDriven, defaults } = useOgImageRuntimeConfig();
|
|
6
|
+
nitroApp.hooks.hook("content:file:afterParse", async (content) => {
|
|
7
|
+
if (content._draft || content._extension !== "md" || content._partial || content.indexable === false || content.index === false)
|
|
8
|
+
return;
|
|
9
|
+
let path = content.path;
|
|
10
|
+
if (isNuxtContentDocumentDriven)
|
|
11
|
+
path = content._path;
|
|
12
|
+
if (path && content.ogImage) {
|
|
13
|
+
const ogImageConfig = typeof content.ogImage === "object" ? content.ogImage : {};
|
|
14
|
+
const optionsWithDefault = defu(ogImageConfig, defaults);
|
|
15
|
+
const src = getOgImagePath(path, optionsWithDefault);
|
|
16
|
+
const payload = {
|
|
17
|
+
title: content.title,
|
|
18
|
+
excerpt: content.description || content.excerpt,
|
|
19
|
+
...content.ogImage
|
|
20
|
+
};
|
|
21
|
+
Object.entries(ogImageConfig).forEach(([key, val]) => {
|
|
22
|
+
payload[key.replace(/-([a-z])/g, (g) => g[1].toUpperCase())] = val;
|
|
23
|
+
});
|
|
24
|
+
content.head = defu({
|
|
25
|
+
script: [
|
|
26
|
+
{
|
|
27
|
+
id: "nuxt-og-image-overrides",
|
|
28
|
+
type: "application/json",
|
|
29
|
+
processTemplateParams: true,
|
|
30
|
+
innerHTML: stringify(payload),
|
|
31
|
+
// we want this to be last in our head
|
|
32
|
+
tagPosition: "bodyClose",
|
|
33
|
+
tagPriority: 30
|
|
34
|
+
// slighty higher priority
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
meta: [
|
|
38
|
+
{ property: "og:image", content: src },
|
|
39
|
+
{ property: "og:image:width", content: optionsWithDefault.width },
|
|
40
|
+
{ property: "og:image:height", content: optionsWithDefault.height },
|
|
41
|
+
{ property: "og:image:type", content: `image/${optionsWithDefault.extension}` },
|
|
42
|
+
{ property: "og:image:alt", content: optionsWithDefault.alt },
|
|
43
|
+
// twitter
|
|
44
|
+
{ name: "twitter:card", content: "summary_large_image" },
|
|
45
|
+
{ name: "twitter:image:src", content: src },
|
|
46
|
+
{ name: "twitter:image:width", content: optionsWithDefault.width },
|
|
47
|
+
{ name: "twitter:image:height", content: optionsWithDefault.height },
|
|
48
|
+
{ name: "twitter:image:alt", content: optionsWithDefault.alt }
|
|
49
|
+
]
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return content;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import type { OgImageOptions } from '../../../types.js';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<OgImageOptions<"NuxtSeo">, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<OgImageOptions<"NuxtSeo"
|
|
3
|
-
[x: string]: unknown;
|
|
4
|
-
}, {}>;
|
|
2
|
+
declare const _default: import("vue").DefineComponent<OgImageOptions<"NuxtSeo">, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<OgImageOptions<"NuxtSeo">> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
3
|
export default _default;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import type { OgImagePageScreenshotOptions } from '../../../types.js';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<OgImagePageScreenshotOptions, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<OgImagePageScreenshotOptions>, {
|
|
3
|
-
[x: string]: unknown;
|
|
4
|
-
}, {}>;
|
|
2
|
+
declare const _default: import("vue").DefineComponent<OgImagePageScreenshotOptions, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<OgImagePageScreenshotOptions> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
3
|
export default _default;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* @credits Nuxt SEO <https://nuxtseo.com/>
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { computed, defineComponent, h, resolveComponent } from 'vue'
|
|
7
|
-
import { useOgImageRuntimeConfig } from '../../../../shared'
|
|
8
6
|
import { useSiteConfig } from '#imports'
|
|
7
|
+
import { useOgImageRuntimeConfig } from '#nuxt-og-image-utils'
|
|
8
|
+
import { computed, defineComponent, h, resolveComponent } from 'vue'
|
|
9
9
|
|
|
10
10
|
// convert to typescript props
|
|
11
11
|
const props = withDefaults(defineProps<{
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { useNuxtApp, useRequestEvent, useRoute } from "#imports";
|
|
1
2
|
import { defu } from "defu";
|
|
2
3
|
import { appendHeader } from "h3";
|
|
4
|
+
import { createNitroRouteRuleMatcher } from "../../nitro/util/kit.js";
|
|
3
5
|
import { getOgImagePath, separateProps, useOgImageRuntimeConfig } from "../../shared.js";
|
|
4
6
|
import { createOgImageMeta, normaliseOptions } from "../utils.js";
|
|
5
|
-
import { createNitroRouteRuleMatcher } from "../../nitro/util/kit.js";
|
|
6
|
-
import { useNuxtApp, useRequestEvent, useRoute } from "#imports";
|
|
7
7
|
export function defineOgImage(_options = {}) {
|
|
8
8
|
if (!import.meta.server)
|
|
9
9
|
return;
|
|
@@ -20,12 +20,14 @@ export function defineOgImage(_options = {}) {
|
|
|
20
20
|
nuxtApp.ssrContext._ogImageInstances = void 0;
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
|
-
const
|
|
23
|
+
const { defaults } = useOgImageRuntimeConfig();
|
|
24
|
+
const options = normaliseOptions(defu({
|
|
24
25
|
..._options
|
|
25
|
-
}
|
|
26
|
+
}, {
|
|
27
|
+
component: defaults.component
|
|
28
|
+
}));
|
|
26
29
|
if (route.query)
|
|
27
30
|
options._query = route.query;
|
|
28
|
-
const { defaults } = useOgImageRuntimeConfig();
|
|
29
31
|
const resolvedOptions = normaliseOptions(defu(separateProps(_options), separateProps(routeRules), defaults));
|
|
30
32
|
if (resolvedOptions.url) {
|
|
31
33
|
createOgImageMeta(null, options, resolvedOptions, nuxtApp.ssrContext);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { ExtractComponentProps, OgImageOptions } from '../../types.js';
|
|
2
1
|
import type { OgImageComponents } from '#nuxt-og-image/components';
|
|
2
|
+
import type { ExtractComponentProps, OgImageOptions } from '../../types.js';
|
|
3
3
|
export declare function defineOgImageComponent<T extends keyof OgImageComponents>(component: T, props?: Partial<ExtractComponentProps<OgImageComponents[T]>>, options?: OgImageOptions): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { DefineOgImageInput, ExtractComponentProps, OgImageOptions, OgImagePageScreenshotOptions } from '../../types.js';
|
|
2
1
|
import type { OgImageComponents } from '#nuxt-og-image/components';
|
|
2
|
+
import type { DefineOgImageInput, ExtractComponentProps, OgImageOptions, OgImagePageScreenshotOptions } from '../../types.js';
|
|
3
3
|
export declare function defineOgImage(_options?: DefineOgImageInput): void;
|
|
4
4
|
export declare function defineOgImageComponent<T extends keyof OgImageComponents>(component: T, props?: Partial<ExtractComponentProps<OgImageComponents[T]>>, options?: OgImageOptions): void;
|
|
5
5
|
export declare function defineOgImageScreenshot(options?: OgImagePageScreenshotOptions): void;
|
|
@@ -1,53 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { defu } from "defu";
|
|
4
|
-
import { parse, stringify } from "devalue";
|
|
5
|
-
import { isInternalRoute, separateProps } from "../../pure.js";
|
|
6
|
-
import { defineNuxtPlugin, useRequestEvent, withSiteUrl } from "#imports";
|
|
1
|
+
import { defineNuxtPlugin } from "#imports";
|
|
2
|
+
import { ogImageCanonicalUrls as setup } from "../utils/plugins.js";
|
|
7
3
|
export default defineNuxtPlugin({
|
|
8
|
-
setup
|
|
9
|
-
nuxtApp.hooks.hook("app:rendered", async (ctx) => {
|
|
10
|
-
const { ssrContext } = ctx;
|
|
11
|
-
const e = useRequestEvent();
|
|
12
|
-
const path = parseURL(e.path).pathname;
|
|
13
|
-
if (isInternalRoute(path))
|
|
14
|
-
return;
|
|
15
|
-
ssrContext?.head.use({
|
|
16
|
-
key: "nuxt-og-image:overrides-and-canonical-urls",
|
|
17
|
-
hooks: {
|
|
18
|
-
"tags:resolve": async (ctx2) => {
|
|
19
|
-
const hasPrimaryPayload = ctx2.tags.some((tag) => tag.tag === "script" && tag.props.id === "nuxt-og-image-options");
|
|
20
|
-
let overrides;
|
|
21
|
-
for (const tag of ctx2.tags) {
|
|
22
|
-
if (tag.tag === "script" && tag.props.id === "nuxt-og-image-overrides") {
|
|
23
|
-
if (hasPrimaryPayload) {
|
|
24
|
-
overrides = separateProps(parse(tag.innerHTML || "{}"));
|
|
25
|
-
delete ctx2.tags[ctx2.tags.indexOf(tag)];
|
|
26
|
-
} else {
|
|
27
|
-
tag.props.id = "nuxt-og-image-options";
|
|
28
|
-
tag.innerHTML = stringify(separateProps(parse(tag.innerHTML || "{}")));
|
|
29
|
-
tag._d = "script:id:nuxt-og-image-options";
|
|
30
|
-
}
|
|
31
|
-
break;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
ctx2.tags = ctx2.tags.filter(Boolean);
|
|
35
|
-
for (const tag of ctx2.tags) {
|
|
36
|
-
if (tag.tag === "meta" && (tag.props.property === "og:image" || ["twitter:image:src", "twitter:image"].includes(tag.props.name))) {
|
|
37
|
-
if (!tag.props.content.startsWith("https")) {
|
|
38
|
-
await nuxtApp.runWithContext(() => {
|
|
39
|
-
tag.props.content = toValue(withSiteUrl(tag.props.content, {
|
|
40
|
-
withBase: true
|
|
41
|
-
}));
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
} else if (overrides && tag.tag === "script" && tag.props.id === "nuxt-og-image-options") {
|
|
45
|
-
tag.innerHTML = stringify(defu(overrides, parse(tag.innerHTML)));
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
}
|
|
4
|
+
setup
|
|
53
5
|
});
|
|
@@ -1,37 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { createOgImageMeta, normaliseOptions } from "../utils.js";
|
|
6
|
-
import { defineNuxtPlugin, useRequestEvent } from "#imports";
|
|
7
|
-
export default defineNuxtPlugin((nuxtApp) => {
|
|
8
|
-
nuxtApp.hooks.hook("app:rendered", async (ctx) => {
|
|
9
|
-
const { ssrContext } = ctx;
|
|
10
|
-
const e = useRequestEvent();
|
|
11
|
-
const path = parseURL(e.path).pathname;
|
|
12
|
-
if (isInternalRoute(path))
|
|
13
|
-
return;
|
|
14
|
-
const _routeRulesMatcher = toRouteMatcher(
|
|
15
|
-
createRadixRouter({ routes: ssrContext?.runtimeConfig?.nitro?.routeRules })
|
|
16
|
-
);
|
|
17
|
-
let routeRules = defu({}, ..._routeRulesMatcher.matchAll(
|
|
18
|
-
withoutBase(path.split("?")[0], ssrContext?.runtimeConfig?.app.baseURL)
|
|
19
|
-
).reverse()).ogImage;
|
|
20
|
-
if (typeof routeRules === "undefined")
|
|
21
|
-
return;
|
|
22
|
-
const ogImageInstances = nuxtApp.ssrContext._ogImageInstances || [];
|
|
23
|
-
if (routeRules === false) {
|
|
24
|
-
ogImageInstances?.forEach((e2) => {
|
|
25
|
-
e2.dispose();
|
|
26
|
-
});
|
|
27
|
-
nuxtApp.ssrContext._ogImagePayload = void 0;
|
|
28
|
-
nuxtApp.ssrContext._ogImageInstances = void 0;
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
routeRules = normaliseOptions(defu(nuxtApp.ssrContext?.event.context._nitro?.routeRules?.ogImage, routeRules));
|
|
32
|
-
const { defaults } = useOgImageRuntimeConfig();
|
|
33
|
-
const resolvedOptions = normaliseOptions(defu(routeRules, defaults));
|
|
34
|
-
const src = getOgImagePath(ssrContext.url, resolvedOptions);
|
|
35
|
-
createOgImageMeta(src, routeRules, resolvedOptions, nuxtApp.ssrContext);
|
|
36
|
-
});
|
|
1
|
+
import { defineNuxtPlugin } from "#imports";
|
|
2
|
+
import { routeRuleOgImage as setup } from "../utils/plugins.js";
|
|
3
|
+
export default defineNuxtPlugin({
|
|
4
|
+
setup
|
|
37
5
|
});
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { useRequestEvent, withSiteUrl } from "#imports";
|
|
2
|
+
import { defu } from "defu";
|
|
3
|
+
import { parse, stringify } from "devalue";
|
|
4
|
+
import { createRouter as createRadixRouter, toRouteMatcher } from "radix3";
|
|
5
|
+
import { parseURL, withoutBase } from "ufo";
|
|
6
|
+
import { toValue } from "vue";
|
|
7
|
+
import { createOgImageMeta, normaliseOptions } from "../../nuxt/utils.js";
|
|
8
|
+
import { isInternalRoute, separateProps } from "../../pure.js";
|
|
9
|
+
import { getOgImagePath, useOgImageRuntimeConfig } from "../../shared.js";
|
|
10
|
+
export function ogImageCanonicalUrls(nuxtApp) {
|
|
11
|
+
nuxtApp.hooks.hook("app:rendered", async (ctx) => {
|
|
12
|
+
const { ssrContext } = ctx;
|
|
13
|
+
const e = useRequestEvent();
|
|
14
|
+
const path = parseURL(e.path).pathname;
|
|
15
|
+
if (isInternalRoute(path))
|
|
16
|
+
return;
|
|
17
|
+
ssrContext?.head.use({
|
|
18
|
+
key: "nuxt-og-image:overrides-and-canonical-urls",
|
|
19
|
+
hooks: {
|
|
20
|
+
"tags:resolve": async (ctx2) => {
|
|
21
|
+
const hasPrimaryPayload = ctx2.tags.some((tag) => tag.tag === "script" && tag.props.id === "nuxt-og-image-options");
|
|
22
|
+
let overrides;
|
|
23
|
+
for (const tag of ctx2.tags) {
|
|
24
|
+
if (tag.tag === "script" && tag.props.id === "nuxt-og-image-overrides") {
|
|
25
|
+
if (hasPrimaryPayload) {
|
|
26
|
+
overrides = separateProps(parse(tag.innerHTML || "{}"));
|
|
27
|
+
delete ctx2.tags[ctx2.tags.indexOf(tag)];
|
|
28
|
+
} else {
|
|
29
|
+
tag.props.id = "nuxt-og-image-options";
|
|
30
|
+
tag.innerHTML = stringify(separateProps(parse(tag.innerHTML || "{}")));
|
|
31
|
+
tag._d = "script:id:nuxt-og-image-options";
|
|
32
|
+
}
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
ctx2.tags = ctx2.tags.filter(Boolean);
|
|
37
|
+
for (const tag of ctx2.tags) {
|
|
38
|
+
if (tag.tag === "meta" && (tag.props.property === "og:image" || ["twitter:image:src", "twitter:image"].includes(tag.props.name))) {
|
|
39
|
+
if (!tag.props.content.startsWith("https")) {
|
|
40
|
+
await nuxtApp.runWithContext(() => {
|
|
41
|
+
tag.props.content = toValue(withSiteUrl(tag.props.content, {
|
|
42
|
+
withBase: true
|
|
43
|
+
}));
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
} else if (overrides && tag.tag === "script" && tag.props.id === "nuxt-og-image-options") {
|
|
47
|
+
tag.innerHTML = stringify(defu(overrides, parse(tag.innerHTML)));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
export function routeRuleOgImage(nuxtApp) {
|
|
56
|
+
nuxtApp.hooks.hook("app:rendered", async (ctx) => {
|
|
57
|
+
const { ssrContext } = ctx;
|
|
58
|
+
const e = useRequestEvent();
|
|
59
|
+
const path = parseURL(e.path).pathname;
|
|
60
|
+
if (isInternalRoute(path))
|
|
61
|
+
return;
|
|
62
|
+
const _routeRulesMatcher = toRouteMatcher(
|
|
63
|
+
createRadixRouter({ routes: ssrContext?.runtimeConfig?.nitro?.routeRules })
|
|
64
|
+
);
|
|
65
|
+
let routeRules = defu({}, ..._routeRulesMatcher.matchAll(
|
|
66
|
+
withoutBase(path.split("?")[0], ssrContext?.runtimeConfig?.app.baseURL)
|
|
67
|
+
).reverse()).ogImage;
|
|
68
|
+
if (typeof routeRules === "undefined")
|
|
69
|
+
return;
|
|
70
|
+
const ogImageInstances = nuxtApp.ssrContext._ogImageInstances || [];
|
|
71
|
+
if (routeRules === false) {
|
|
72
|
+
ogImageInstances?.forEach((e2) => {
|
|
73
|
+
e2.dispose();
|
|
74
|
+
});
|
|
75
|
+
nuxtApp.ssrContext._ogImagePayload = void 0;
|
|
76
|
+
nuxtApp.ssrContext._ogImageInstances = void 0;
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const { defaults } = useOgImageRuntimeConfig();
|
|
80
|
+
routeRules = normaliseOptions(defu(nuxtApp.ssrContext?.event.context._nitro?.routeRules?.ogImage, routeRules, {
|
|
81
|
+
component: defaults.component
|
|
82
|
+
}));
|
|
83
|
+
const resolvedOptions = normaliseOptions(defu(routeRules, defaults));
|
|
84
|
+
const src = getOgImagePath(ssrContext.url, resolvedOptions);
|
|
85
|
+
createOgImageMeta(src, routeRules, resolvedOptions, nuxtApp.ssrContext);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { componentNames } from "#build/nuxt-og-image/components.mjs";
|
|
2
|
+
import { unref, useServerHead } from "#imports";
|
|
3
|
+
import { resolveUnrefHeadInput } from "@unhead/vue";
|
|
1
4
|
import { defu } from "defu";
|
|
2
|
-
import { withQuery } from "ufo";
|
|
3
5
|
import { stringify } from "devalue";
|
|
4
|
-
import {
|
|
6
|
+
import { withQuery } from "ufo";
|
|
5
7
|
import { getExtension, separateProps } from "../shared.js";
|
|
6
|
-
import { unref, useServerHead } from "#imports";
|
|
7
|
-
import { componentNames } from "#build/nuxt-og-image/components.mjs";
|
|
8
8
|
export function createOgImageMeta(src, input, resolvedOptions, ssrContext) {
|
|
9
9
|
const _input = separateProps(defu(input, ssrContext._ogImagePayload));
|
|
10
10
|
let url = src || input.url || resolvedOptions.url;
|
|
@@ -74,6 +74,8 @@ export function normaliseOptions(_options) {
|
|
|
74
74
|
break;
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
+
} else if (!options.component) {
|
|
78
|
+
options.component = componentNames[0]?.pascalName;
|
|
77
79
|
}
|
|
78
80
|
return options;
|
|
79
81
|
}
|
package/dist/runtime/shared.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { joinURL } from "ufo";
|
|
2
|
-
import { defu } from "defu";
|
|
3
1
|
import { useRuntimeConfig } from "#imports";
|
|
2
|
+
import { defu } from "defu";
|
|
3
|
+
import { joinURL } from "ufo";
|
|
4
4
|
export * from "./pure.js";
|
|
5
5
|
export function getOgImagePath(pagePath, _options) {
|
|
6
6
|
const baseURL = useRuntimeConfig().app.baseURL;
|
|
7
7
|
const options = defu(_options, useOgImageRuntimeConfig().defaults);
|
|
8
|
-
return joinURL("/", baseURL,
|
|
8
|
+
return joinURL("/", baseURL, `__og-image__/${import.meta.prerender ? "static" : "image"}`, pagePath, `og.${options.extension}`);
|
|
9
9
|
}
|
|
10
10
|
export function useOgImageRuntimeConfig() {
|
|
11
11
|
return useRuntimeConfig()["nuxt-og-image"];
|
package/dist/runtime/types.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { H3Error, H3Event } from 'h3';
|
|
1
|
+
import type { OgImageComponents } from '#nuxt-og-image/components';
|
|
3
2
|
import type { ResvgRenderOptions } from '@resvg/resvg-js';
|
|
4
|
-
import type { SatoriOptions } from 'satori';
|
|
5
3
|
import type { AllowedComponentProps, Component, ComponentCustomProps, VNodeProps } from '@vue/runtime-core';
|
|
6
|
-
import type {
|
|
4
|
+
import type { H3Error, H3Event } from 'h3';
|
|
7
5
|
import type { NitroApp, NitroOptions } from 'nitropack';
|
|
8
|
-
import type {
|
|
6
|
+
import type { SatoriOptions } from 'satori';
|
|
7
|
+
import type { html } from 'satori-html';
|
|
8
|
+
import type { SharpOptions } from 'sharp';
|
|
9
9
|
export interface OgImageRenderEventContext {
|
|
10
10
|
e: H3Event;
|
|
11
11
|
extension: 'png' | 'jpeg' | 'jpg' | 'svg' | 'html' | 'json';
|
|
@@ -31,6 +31,7 @@ export interface OgImageRuntimeConfig {
|
|
|
31
31
|
hasNuxtIcon: boolean;
|
|
32
32
|
colorPreference: 'light' | 'dark';
|
|
33
33
|
isNuxtContentDocumentDriven: boolean;
|
|
34
|
+
zeroRuntime: boolean;
|
|
34
35
|
}
|
|
35
36
|
export interface OgImageComponent {
|
|
36
37
|
path?: string;
|
package/dist/types.d.mts
CHANGED
package/dist/types.d.ts
CHANGED