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.
Files changed (353) hide show
  1. package/README.md +3 -6
  2. package/dist/client/200.html +179 -179
  3. package/dist/client/404.html +179 -179
  4. package/dist/client/_nuxt/{BfBkfEDj.js → 0OCEc-sb.js} +1 -1
  5. package/dist/client/_nuxt/16nqZaIT.js +1 -0
  6. package/dist/client/_nuxt/3Ts0ZrM4.js +4 -0
  7. package/dist/client/_nuxt/44JOqR_V.js +1 -0
  8. package/dist/client/_nuxt/4FkZXfg1.js +3 -0
  9. package/dist/client/_nuxt/{DoY4Dbtn.js → 4WleZr1P.js} +1 -1
  10. package/dist/client/_nuxt/5HixFuyr.js +1 -0
  11. package/dist/client/_nuxt/{C31OBGbl.js → 5bRVBCrv.js} +1 -1
  12. package/dist/client/_nuxt/{DanM9F4-.js → 7LPQ6a13.js} +2 -2
  13. package/dist/client/_nuxt/8WiSp-0_.js +1 -0
  14. package/dist/client/_nuxt/9CfBjzQa.js +1 -0
  15. package/dist/client/_nuxt/B-9EjyZr.js +1 -0
  16. package/dist/client/_nuxt/B-a2BbyY.js +1 -0
  17. package/dist/client/_nuxt/B0LoMq2b.js +1 -0
  18. package/dist/client/_nuxt/{BSSAUge4.js → B1ejXUAS.js} +1 -1
  19. package/dist/client/_nuxt/{DhldU3XI.js → B3LRAdDP.js} +1 -1
  20. package/dist/client/_nuxt/B7-FEXAT.js +1 -0
  21. package/dist/client/_nuxt/B9HI_aQy.js +1 -0
  22. package/dist/client/_nuxt/{D85lwgPO.js → B9vFkdfw.js} +1 -1
  23. package/dist/client/_nuxt/BAGvEKUB.js +1 -0
  24. package/dist/client/_nuxt/BAp2aEeE.js +1 -0
  25. package/dist/client/_nuxt/{C3NvtN4M.js → BB9S_66N.js} +1 -1
  26. package/dist/client/_nuxt/{AoxqhCl0.js → BCOu96sC.js} +1 -1
  27. package/dist/client/_nuxt/BGk6HrHT.js +1 -0
  28. package/dist/client/_nuxt/BHSTd-7M.js +1 -0
  29. package/dist/client/_nuxt/BKFBoKT4.js +1 -0
  30. package/dist/client/_nuxt/BKNiEhql.js +1 -0
  31. package/dist/client/_nuxt/BNgG76gt.js +1 -0
  32. package/dist/client/_nuxt/{BbPU79SD.js → BNofkYSZ.js} +14 -14
  33. package/dist/client/_nuxt/BOp3HRET.js +1 -0
  34. package/dist/client/_nuxt/{DaDGU6kf.js → BQnHL-cn.js} +1 -1
  35. package/dist/client/_nuxt/BS9sT-GQ.js +1 -0
  36. package/dist/client/_nuxt/BU83OF-G.js +1 -0
  37. package/dist/client/_nuxt/BUeIC4cT.js +1 -0
  38. package/dist/client/_nuxt/BXUVD3TH.js +1 -0
  39. package/dist/client/_nuxt/BXWtGw2n.js +6 -0
  40. package/dist/client/_nuxt/{VVtMly4c.js → BYLuaE_S.js} +1 -1
  41. package/dist/client/_nuxt/{C46DigdT.js → Ba_2pva2.js} +1 -1
  42. package/dist/client/_nuxt/BeX7BQ1y.js +1 -0
  43. package/dist/client/_nuxt/{ChVe37jp.js → BfVRrWqI.js} +1 -1
  44. package/dist/client/_nuxt/BgEvnnZj.js +1 -0
  45. package/dist/client/_nuxt/{BEPTDMGr.js → Bgrlo6mM.js} +1 -1
  46. package/dist/client/_nuxt/{CBoehFVA.js → Bl6w8nq6.js} +2 -2
  47. package/dist/client/_nuxt/BmUjtHPt.js +1 -0
  48. package/dist/client/_nuxt/BnYPtiAB.js +1 -0
  49. package/dist/client/_nuxt/{B9S9BZZh.js → BotTw_1M.js} +1 -1
  50. package/dist/client/_nuxt/BpqPLH6b.js +1 -0
  51. package/dist/client/_nuxt/{DT2db06B.js → Br4herk8.js} +1 -1
  52. package/dist/client/_nuxt/Brmco9EZ.js +2 -0
  53. package/dist/client/_nuxt/{BiU8-mv6.js → Bs9WCFOo.js} +1 -1
  54. package/dist/client/_nuxt/BtPWTO6-.js +1 -0
  55. package/dist/client/_nuxt/BwUg_Rem.js +1 -0
  56. package/dist/client/_nuxt/Bxuka25Y.js +1 -0
  57. package/dist/client/_nuxt/{Bcn1f5Rp.js → BxwkrKyP.js} +1 -1
  58. package/dist/client/_nuxt/{D9s3Eyz8.js → ByN1NmdT.js} +2 -2
  59. package/dist/client/_nuxt/C2Z2wNnw.js +1 -0
  60. package/dist/client/_nuxt/{DGTPbQyx.js → C3wf4cjV.js} +1 -1
  61. package/dist/client/_nuxt/{16u1w-DC.js → C5J_9lw5.js} +1 -1
  62. package/dist/client/_nuxt/C6doOGgB.js +1 -0
  63. package/dist/client/_nuxt/{BY8_eel9.js → C7xspq5a.js} +1 -1
  64. package/dist/client/_nuxt/C9CNr0dZ.js +1 -0
  65. package/dist/client/_nuxt/CA2blNRc.js +1 -0
  66. package/dist/client/_nuxt/{DFQMbhFG.js → CCW61mLD.js} +1 -1
  67. package/dist/client/_nuxt/{DOt8O2FJ.js → CDP-pALJ.js} +1 -1
  68. package/dist/client/_nuxt/{LrshOcZ2.js → CFy8Z7mU.js} +1 -1
  69. package/dist/client/_nuxt/CHDuk4cg.js +1 -0
  70. package/dist/client/_nuxt/{B5v32tNS.js → CKK8qrH7.js} +2 -2
  71. package/dist/client/_nuxt/CKqhLkpw.js +1 -0
  72. package/dist/client/_nuxt/{MJ0gDQnJ.js → CLTURUqp.js} +3 -3
  73. package/dist/client/_nuxt/CPQn-Lhb.js +1 -0
  74. package/dist/client/_nuxt/CRUEGcu5.js +1 -0
  75. package/dist/client/_nuxt/{CT9A9Qiu.js → CS6sTstm.js} +1 -1
  76. package/dist/client/_nuxt/{DWE3vCE5.js → CSPPpfsQ.js} +1 -1
  77. package/dist/client/_nuxt/CTeQKLZv.js +1 -0
  78. package/dist/client/_nuxt/CTsPJjdJ.js +1 -0
  79. package/dist/client/_nuxt/{A4Fa72hX.js → CUNQUWO_.js} +1 -1
  80. package/dist/client/_nuxt/CV5B5C80.js +1 -0
  81. package/dist/client/_nuxt/CZkFsSlX.js +1 -0
  82. package/dist/client/_nuxt/{8R90CSQj.js → C_h5G2He.js} +1 -1
  83. package/dist/client/_nuxt/{B5--Xptx.js → CaR_I2C-.js} +1 -1
  84. package/dist/client/_nuxt/Cb48SAmt.js +1 -0
  85. package/dist/client/_nuxt/{nc-bU77P.js → CeIpHJfZ.js} +3 -3
  86. package/dist/client/_nuxt/{coyhVBVA.js → ClPxYbPx.js} +1 -1
  87. package/dist/client/_nuxt/Clj_IpB8.js +1 -0
  88. package/dist/client/_nuxt/CmN1UzhW.js +1 -0
  89. package/dist/client/_nuxt/CvHWZNAB.js +1 -0
  90. package/dist/client/_nuxt/CyUS7F7b.js +17 -0
  91. package/dist/client/_nuxt/{D4LJwL2b.js → Cz-n9WvF.js} +1 -1
  92. package/dist/client/_nuxt/{CDzo4tzE.js → Cz3ygVR-.js} +1 -1
  93. package/dist/client/_nuxt/{CEuqc8ZQ.js → CzK8D06Z.js} +1 -1
  94. package/dist/client/_nuxt/{CXYaz1c9.js → D0N_qbs7.js} +1 -1
  95. package/dist/client/_nuxt/D0pnavP-.js +1 -0
  96. package/dist/client/_nuxt/D25Gr2Wc.js +1 -0
  97. package/dist/client/_nuxt/D4miJ1xw.js +1 -0
  98. package/dist/client/_nuxt/D6oCKXcX.js +1 -0
  99. package/dist/client/_nuxt/DBLgxP_1.js +2 -0
  100. package/dist/client/_nuxt/{ByMv4Xf1.js → DCmDdbvy.js} +1 -1
  101. package/dist/client/_nuxt/{zt9m_cFA.js → DDG_rSGg.js} +1 -1
  102. package/dist/client/_nuxt/DFHN_7lU.js +3 -0
  103. package/dist/client/_nuxt/DFsxFixh.js +1 -0
  104. package/dist/client/_nuxt/DGhhRy1e.js +1 -0
  105. package/dist/client/_nuxt/{DdacRhvC.js → DIw1DfnK.js} +1 -1
  106. package/dist/client/_nuxt/DJNHLfzP.js +1 -0
  107. package/dist/client/_nuxt/{XP2_9bVu.js → DJOPMAPO.js} +1 -1
  108. package/dist/client/_nuxt/DO04iIl4.js +1 -0
  109. package/dist/client/_nuxt/DOOuMSMh.js +1 -0
  110. package/dist/client/_nuxt/DRuVOcqL.js +1 -0
  111. package/dist/client/_nuxt/{B2Zkg-Ae.js → DSv7Jr7N.js} +2 -2
  112. package/dist/client/_nuxt/DTMFIK7w.js +1 -0
  113. package/dist/client/_nuxt/{6XBPEST2.js → DXdsTRaC.js} +1 -1
  114. package/dist/client/_nuxt/{DgraCSOE.js → DXtfa3TF.js} +1 -1
  115. package/dist/client/_nuxt/{iYrPSY0y.js → DYgwfmdY.js} +1 -1
  116. package/dist/client/_nuxt/DYikCEmq.js +1 -0
  117. package/dist/client/_nuxt/{D6SwP_ef.js → DYrknm32.js} +1 -1
  118. package/dist/client/_nuxt/D_lsq3cR.js +1 -0
  119. package/dist/client/_nuxt/{4JG6XROL.js → Dc3u8CCo.js} +1 -1
  120. package/dist/client/_nuxt/Df4vQnuo.js +1 -0
  121. package/dist/client/_nuxt/Di1G_BEd.js +1 -0
  122. package/dist/client/_nuxt/Dk2kDqHs.js +1 -0
  123. package/dist/client/_nuxt/DkIL16gc.js +2 -0
  124. package/dist/client/_nuxt/DmixpzPA.js +1 -0
  125. package/dist/client/_nuxt/{CkoJTUbt.js → Dnd6U92I.js} +1 -1
  126. package/dist/client/_nuxt/DofIr7ih.js +1 -0
  127. package/dist/client/_nuxt/DqFtmHIk.js +1 -0
  128. package/dist/client/_nuxt/{DLpTrZod.js → DrUHIbQf.js} +1 -1
  129. package/dist/client/_nuxt/{CJ21IjBY.js → DrhOmAGa.js} +1 -1
  130. package/dist/client/_nuxt/{DmAvib0Y.js → DsO5WfEU.js} +1 -1
  131. package/dist/client/_nuxt/{CIlkkgNU.js → DsclqnHy.js} +1 -1
  132. package/dist/client/_nuxt/Dwk9V841.js +1 -0
  133. package/dist/client/_nuxt/DyLIn2qo.js +1 -0
  134. package/dist/client/_nuxt/{C9d3aiqh.js → DzhYcJWo.js} +1 -1
  135. package/dist/client/_nuxt/{DxX6t7GH.js → Dziqk49f.js} +1 -1
  136. package/dist/client/_nuxt/{DqvgqZmm.js → E5r7Moxb.js} +1 -1
  137. package/dist/client/_nuxt/{B_SUYfiV.js → FMRyFT8D.js} +1 -1
  138. package/dist/client/_nuxt/{TDVTyJvX.js → GACPk8cj.js} +1 -1
  139. package/dist/client/_nuxt/H94RPpLS.js +1 -0
  140. package/dist/client/_nuxt/{DBxHOdLe.js → HxmVvryO.js} +1 -1
  141. package/dist/client/_nuxt/JYC31MTV.js +1 -0
  142. package/dist/client/_nuxt/Jl0QvYgb.js +1 -0
  143. package/dist/client/_nuxt/{C17JnZbq.js → KA8c-whL.js} +1 -1
  144. package/dist/client/_nuxt/Ka_J5llu.js +1 -0
  145. package/dist/client/_nuxt/KuNYkU7X.js +1 -0
  146. package/dist/client/_nuxt/MkuNFWFs.js +204 -0
  147. package/dist/client/_nuxt/{BaedD2tq.js → N3zwmhmW.js} +1 -1
  148. package/dist/client/_nuxt/O4cDyHwR.js +1 -0
  149. package/dist/client/_nuxt/OPd3ySAa.js +1 -0
  150. package/dist/client/_nuxt/{BqpV9M7Y.js → Opso89zU.js} +1 -1
  151. package/dist/client/_nuxt/{CV8JdvfZ.js → PauOf_jS.js} +1 -1
  152. package/dist/client/_nuxt/Qj0mFepl.js +14 -0
  153. package/dist/client/_nuxt/R9SNgiQ9.js +1 -0
  154. package/dist/client/_nuxt/{C6XIsc4F.js → Rc0-bMtX.js} +1 -1
  155. package/dist/client/_nuxt/{CKpfY2P2.js → TYaudu4O.js} +1 -1
  156. package/dist/client/_nuxt/VRCUJX8G.js +1 -0
  157. package/dist/client/_nuxt/{CMiaevpY.js → Ys9ZunwU.js} +1 -1
  158. package/dist/client/_nuxt/builds/latest.json +1 -1
  159. package/dist/client/_nuxt/builds/meta/353519f1-2e76-4016-9b50-2f26f3cb8794.json +1 -0
  160. package/dist/client/_nuxt/{CD1ynQRS.js → eJKZXzCK.js} +1 -1
  161. package/dist/client/_nuxt/{PSVKygaU.js → eQYbbmqd.js} +1 -1
  162. package/dist/client/_nuxt/{entry.cOhDjBNG.css → entry.DtsycVcr.css} +1 -1
  163. package/dist/client/_nuxt/error-404.CUF_CFKB.css +1 -0
  164. package/dist/client/_nuxt/error-500.BR60owpQ.css +1 -0
  165. package/dist/client/_nuxt/i0hkWYmE.js +1 -0
  166. package/dist/client/_nuxt/{ByGMIDPY.js → ithPx4uF.js} +1 -1
  167. package/dist/client/_nuxt/{I-_ljZ1M.js → jDrCW69G.js} +1 -1
  168. package/dist/client/_nuxt/kveMaAK5.js +1 -0
  169. package/dist/client/_nuxt/lBoe4CZw.js +1 -0
  170. package/dist/client/_nuxt/{DoQu802G.js → lPxKsdjn.js} +1 -1
  171. package/dist/client/_nuxt/lRZxrFTT.js +1 -0
  172. package/dist/client/_nuxt/mvTh5Gok.js +1 -0
  173. package/dist/client/_nuxt/pCnzZaOt.js +1 -0
  174. package/dist/client/_nuxt/qpF8edk8.js +1 -0
  175. package/dist/client/_nuxt/qvnQm5y7.js +1 -0
  176. package/dist/client/_nuxt/qwoaayiL.js +1 -0
  177. package/dist/client/_nuxt/t1S7pxBA.js +1 -0
  178. package/dist/client/_nuxt/t6MJYFCU.js +5 -0
  179. package/dist/client/_nuxt/tEd5xQ4M.js +1 -0
  180. package/dist/client/_nuxt/{DZwJH60W.js → xGgVA17b.js} +1 -1
  181. package/dist/client/_nuxt/yvfKceIB.js +1 -0
  182. package/dist/client/_nuxt/{E1IWMS2c.js → z5DqfkHR.js} +1 -1
  183. package/dist/client/index.html +179 -179
  184. package/dist/module.d.mts +5 -1
  185. package/dist/module.d.ts +5 -1
  186. package/dist/module.json +2 -2
  187. package/dist/module.mjs +246 -131
  188. package/dist/runtime/nitro/og-image/bindings/chromium/chrome-launcher.js +1 -1
  189. package/dist/runtime/nitro/og-image/bindings/chromium/on-demand.js +1 -1
  190. package/dist/runtime/nitro/og-image/bindings/satori/wasm.js +1 -1
  191. package/dist/runtime/nitro/og-image/{cache.d.ts → cache/lru.d.ts} +3 -1
  192. package/dist/runtime/nitro/og-image/{cache.js → cache/lru.js} +6 -0
  193. package/dist/runtime/nitro/og-image/cache/mock.d.ts +9 -0
  194. package/dist/runtime/nitro/og-image/cache/mock.js +9 -0
  195. package/dist/runtime/nitro/og-image/chromium/renderer.js +1 -1
  196. package/dist/runtime/nitro/og-image/chromium/screenshot.js +1 -1
  197. package/dist/runtime/nitro/og-image/context.js +8 -8
  198. package/dist/runtime/nitro/og-image/satori/font.d.ts +1 -0
  199. package/dist/runtime/nitro/og-image/satori/font.js +2 -2
  200. package/dist/runtime/nitro/og-image/satori/instances.d.ts +1 -1
  201. package/dist/runtime/nitro/og-image/satori/plugins/encoding.js +1 -1
  202. package/dist/runtime/nitro/og-image/satori/plugins/flex.js +27 -2
  203. package/dist/runtime/nitro/og-image/satori/plugins/imageSrc.js +3 -3
  204. package/dist/runtime/nitro/og-image/satori/plugins/unocss.js +1 -1
  205. package/dist/runtime/nitro/og-image/satori/renderer.js +3 -7
  206. package/dist/runtime/nitro/og-image/satori/transforms/emojis.d.ts +0 -2
  207. package/dist/runtime/nitro/og-image/satori/transforms/emojis.js +1 -5
  208. package/dist/runtime/nitro/og-image/satori/transforms/inlineCss.js +1 -1
  209. package/dist/runtime/nitro/og-image/satori/vnodes.js +8 -8
  210. package/dist/runtime/nitro/og-image/templates/html.js +16 -21
  211. package/dist/runtime/nitro/plugins/__zero-runtime/nuxt-content.d.ts +2 -0
  212. package/dist/runtime/nitro/plugins/__zero-runtime/nuxt-content.js +9 -0
  213. package/dist/runtime/nitro/plugins/nuxt-content.js +2 -52
  214. package/dist/runtime/nitro/plugins/prerender.js +9 -4
  215. package/dist/runtime/nitro/routes/__zero-runtime/font.d.ts +2 -0
  216. package/dist/runtime/nitro/routes/__zero-runtime/font.js +8 -0
  217. package/dist/runtime/nitro/routes/__zero-runtime/image.d.ts +2 -0
  218. package/dist/runtime/nitro/routes/__zero-runtime/image.js +8 -0
  219. package/dist/runtime/nitro/routes/debug.json.js +2 -2
  220. package/dist/runtime/nitro/routes/font.js +3 -49
  221. package/dist/runtime/nitro/routes/image.js +3 -87
  222. package/dist/runtime/nitro/util/cache.js +3 -3
  223. package/dist/runtime/nitro/util/eventHandlers.d.ts +3 -0
  224. package/dist/runtime/nitro/util/eventHandlers.js +155 -0
  225. package/dist/runtime/nitro/util/kit.d.ts +1 -1
  226. package/dist/runtime/nitro/util/kit.js +3 -3
  227. package/dist/runtime/nitro/util/plugins.d.ts +2 -0
  228. package/dist/runtime/nitro/util/plugins.js +54 -0
  229. package/dist/runtime/nuxt/components/OgImage/OgImage.d.ts +1 -3
  230. package/dist/runtime/nuxt/components/OgImage/OgImage.js +1 -1
  231. package/dist/runtime/nuxt/components/OgImage/OgImageScreenshot.d.ts +1 -3
  232. package/dist/runtime/nuxt/components/OgImage/OgImageScreenshot.js +1 -1
  233. package/dist/runtime/nuxt/components/Templates/Community/NuxtSeo.vue +2 -2
  234. package/dist/runtime/nuxt/components/Templates/Community/SimpleBlog.vue +1 -1
  235. package/dist/runtime/nuxt/composables/defineOgImage.js +7 -5
  236. package/dist/runtime/nuxt/composables/defineOgImageComponent.d.ts +1 -1
  237. package/dist/runtime/nuxt/composables/mock.d.ts +1 -1
  238. package/dist/runtime/nuxt/plugins/__zero-runtime/og-image-canonical-urls.server.d.ts +2 -0
  239. package/dist/runtime/nuxt/plugins/__zero-runtime/og-image-canonical-urls.server.js +9 -0
  240. package/dist/runtime/nuxt/plugins/__zero-runtime/route-rule-og-image.server.d.ts +2 -0
  241. package/dist/runtime/nuxt/plugins/__zero-runtime/route-rule-og-image.server.js +9 -0
  242. package/dist/runtime/nuxt/plugins/og-image-canonical-urls.server.js +3 -51
  243. package/dist/runtime/nuxt/plugins/route-rule-og-image.server.js +4 -36
  244. package/dist/runtime/nuxt/utils/plugins.d.ts +3 -0
  245. package/dist/runtime/nuxt/utils/plugins.js +87 -0
  246. package/dist/runtime/nuxt/utils.js +6 -4
  247. package/dist/runtime/shared.js +3 -3
  248. package/dist/runtime/types.d.ts +6 -5
  249. package/dist/types.d.mts +0 -4
  250. package/dist/types.d.ts +0 -4
  251. package/package.json +31 -23
  252. package/dist/client/_nuxt/6bkCFmAg.js +0 -1
  253. package/dist/client/_nuxt/B3yJX9Qu.js +0 -1
  254. package/dist/client/_nuxt/B5USdwzW.js +0 -1
  255. package/dist/client/_nuxt/B7zm8LFH.js +0 -2
  256. package/dist/client/_nuxt/B8yeR86s.js +0 -1
  257. package/dist/client/_nuxt/B9MAV_WH.js +0 -1
  258. package/dist/client/_nuxt/B9afuS00.js +0 -1
  259. package/dist/client/_nuxt/BDUkJJFZ.js +0 -1
  260. package/dist/client/_nuxt/BEIEqD7s.js +0 -1
  261. package/dist/client/_nuxt/BESheOyt.js +0 -1
  262. package/dist/client/_nuxt/BFO9THtE.js +0 -1
  263. package/dist/client/_nuxt/BICcMyTi.js +0 -1
  264. package/dist/client/_nuxt/BIboXAcp.js +0 -1
  265. package/dist/client/_nuxt/BNuYtHxo.js +0 -1
  266. package/dist/client/_nuxt/BOCDpWc1.js +0 -17
  267. package/dist/client/_nuxt/BOtZLFcM.js +0 -3
  268. package/dist/client/_nuxt/BPiaQZfK.js +0 -1
  269. package/dist/client/_nuxt/BQgbS7Yt.js +0 -1
  270. package/dist/client/_nuxt/BSrQBeSJ.js +0 -131
  271. package/dist/client/_nuxt/BTO_K1fm.js +0 -1
  272. package/dist/client/_nuxt/BUQ2FcJX.js +0 -1
  273. package/dist/client/_nuxt/BVsCzzYp.js +0 -1
  274. package/dist/client/_nuxt/BccEf5hb.js +0 -1
  275. package/dist/client/_nuxt/BeqgMazi.js +0 -1
  276. package/dist/client/_nuxt/BltGI4TE.js +0 -1
  277. package/dist/client/_nuxt/BrHEiNXv.js +0 -1
  278. package/dist/client/_nuxt/BspO9hSn.js +0 -1
  279. package/dist/client/_nuxt/Bszlo9K_.js +0 -1
  280. package/dist/client/_nuxt/Bt3jdO27.js +0 -1
  281. package/dist/client/_nuxt/BzeF2RWN.js +0 -1
  282. package/dist/client/_nuxt/C5QX-GgJ.js +0 -1
  283. package/dist/client/_nuxt/C6F4YvHi.js +0 -1
  284. package/dist/client/_nuxt/C6pBAdyX.js +0 -1
  285. package/dist/client/_nuxt/C7O_L2NY.js +0 -1
  286. package/dist/client/_nuxt/C8KGJGmD.js +0 -1
  287. package/dist/client/_nuxt/C9X_x5J1.js +0 -1
  288. package/dist/client/_nuxt/CAkjjYd_.js +0 -1
  289. package/dist/client/_nuxt/CDLXdqou.js +0 -6
  290. package/dist/client/_nuxt/CTjLfFPV.js +0 -1
  291. package/dist/client/_nuxt/CY-WakqA.js +0 -1
  292. package/dist/client/_nuxt/C_D4IvTY.js +0 -1
  293. package/dist/client/_nuxt/CbFpZgCV.js +0 -1
  294. package/dist/client/_nuxt/CbjS_D4a.js +0 -1
  295. package/dist/client/_nuxt/CeUooOMz.js +0 -1
  296. package/dist/client/_nuxt/Clnf9f06.js +0 -1
  297. package/dist/client/_nuxt/CmHkUvIV.js +0 -1
  298. package/dist/client/_nuxt/CmonagEV.js +0 -1
  299. package/dist/client/_nuxt/CowR2XfX.js +0 -1
  300. package/dist/client/_nuxt/CuJfdYLG.js +0 -1
  301. package/dist/client/_nuxt/CwZIVF5c.js +0 -1
  302. package/dist/client/_nuxt/Cwv93qcC.js +0 -4
  303. package/dist/client/_nuxt/CzrtbdtR.js +0 -1
  304. package/dist/client/_nuxt/D1i8Vxii.js +0 -1
  305. package/dist/client/_nuxt/D384ylkT.js +0 -1
  306. package/dist/client/_nuxt/D7Nx8OLD.js +0 -1
  307. package/dist/client/_nuxt/D8YTaFMU.js +0 -1
  308. package/dist/client/_nuxt/D8ecWW_g.js +0 -1
  309. package/dist/client/_nuxt/DA288kE2.js +0 -3
  310. package/dist/client/_nuxt/DAVo6uMX.js +0 -1
  311. package/dist/client/_nuxt/DFRYOy8B.js +0 -1
  312. package/dist/client/_nuxt/DHCC4-m4.js +0 -1
  313. package/dist/client/_nuxt/DIC-ECB_.js +0 -1
  314. package/dist/client/_nuxt/DKluMpTE.js +0 -1
  315. package/dist/client/_nuxt/DKrjeWrU.js +0 -1
  316. package/dist/client/_nuxt/DOwv4Xrr.js +0 -1
  317. package/dist/client/_nuxt/DQdnirlo.js +0 -1
  318. package/dist/client/_nuxt/DRgydeCt.js +0 -1
  319. package/dist/client/_nuxt/DS9ZWoKD.js +0 -1
  320. package/dist/client/_nuxt/DSPtUMMI.js +0 -1
  321. package/dist/client/_nuxt/DYQagCV4.js +0 -1
  322. package/dist/client/_nuxt/DfqM7apN.js +0 -1
  323. package/dist/client/_nuxt/Dm9yFT8Y.js +0 -2
  324. package/dist/client/_nuxt/DoDCNZ2x.js +0 -1
  325. package/dist/client/_nuxt/Dtv2yyrc.js +0 -1
  326. package/dist/client/_nuxt/DvreHBtf.js +0 -1
  327. package/dist/client/_nuxt/DvyTQcux.js +0 -1
  328. package/dist/client/_nuxt/H2A8RXvM.js +0 -1
  329. package/dist/client/_nuxt/KCgU82S2.js +0 -1
  330. package/dist/client/_nuxt/NboNzovp.js +0 -1
  331. package/dist/client/_nuxt/PYrcYqZ1.js +0 -1
  332. package/dist/client/_nuxt/SXuYmi6B.js +0 -1
  333. package/dist/client/_nuxt/Sm_sVxcW.js +0 -14
  334. package/dist/client/_nuxt/Wkyh6-uf.js +0 -1
  335. package/dist/client/_nuxt/XrZDCB4K.js +0 -1
  336. package/dist/client/_nuxt/_fwBhpzY.js +0 -1
  337. package/dist/client/_nuxt/a0z0KVy-.js +0 -5
  338. package/dist/client/_nuxt/bPMpiWut.js +0 -1
  339. package/dist/client/_nuxt/builds/meta/517cb958-776a-47e2-bd34-69240f18e412.json +0 -1
  340. package/dist/client/_nuxt/d2PdAb0u.js +0 -2
  341. package/dist/client/_nuxt/error-404.F6YJ8FEX.css +0 -1
  342. package/dist/client/_nuxt/error-500.TGideFTg.css +0 -1
  343. package/dist/client/_nuxt/g4vhSHS2.js +0 -1
  344. package/dist/client/_nuxt/kZiYIjIU.js +0 -1
  345. package/dist/client/_nuxt/lOwNZ7_V.js +0 -1
  346. package/dist/client/_nuxt/nfCtBF4F.js +0 -1
  347. package/dist/client/_nuxt/pit2X7C0.js +0 -1
  348. package/dist/client/_nuxt/r5D-aIjp.js +0 -1
  349. package/dist/client/_nuxt/rh45RTDP.js +0 -1
  350. package/dist/client/_nuxt/tgs8ujlj.js +0 -1
  351. package/dist/client/_nuxt/v_4dTNAb.js +0 -1
  352. package/dist/client/_nuxt/vvK2q8Zt.js +0 -1
  353. 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 { createRouter as createRadixRouter, toRouteMatcher } from "radix3";
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 { useRuntimeConfig } from "#imports";
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,2 @@
1
+ import type { NitroApp } from 'nitropack';
2
+ export declare function nuxtContentPlugin(nitroApp: NitroApp): void;
@@ -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,5 @@
1
- import { defineComponent } from "vue";
2
1
  import { defineOgImage } from "#imports";
2
+ import { defineComponent } from "vue";
3
3
  export default defineComponent({
4
4
  name: "OgImage",
5
5
  async setup(_, { attrs }) {
@@ -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;
@@ -1,5 +1,5 @@
1
- import { defineComponent } from "vue";
2
1
  import { defineOgImageScreenshot } from "#imports";
2
+ import { defineComponent } from "vue";
3
3
  export default defineComponent({
4
4
  name: "OgImageScreenshot",
5
5
  async setup(_, { attrs }) {
@@ -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<{
@@ -3,8 +3,8 @@
3
3
  * @credits Full Stack Heroes <https://fullstackheroes.com/>
4
4
  */
5
5
 
6
- import { parseURL } from 'ufo'
7
6
  import { computed, useSiteConfig } from '#imports'
7
+ import { parseURL } from 'ufo'
8
8
 
9
9
  const props = withDefaults(defineProps<{
10
10
  title?: string
@@ -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 options = normaliseOptions({
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;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
2
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import { defineNuxtPlugin } from "#imports";
2
+ import { ogImageCanonicalUrls as setup } from "../../utils/plugins.js";
3
+ export default defineNuxtPlugin({
4
+ setup(nuxtApp) {
5
+ if (import.meta.dev || import.meta.prerender) {
6
+ setup(nuxtApp);
7
+ }
8
+ }
9
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
2
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import { defineNuxtPlugin } from "#imports";
2
+ import { routeRuleOgImage as setup } from "../../utils/plugins.js";
3
+ export default defineNuxtPlugin({
4
+ setup(nuxtApp) {
5
+ if (import.meta.dev || import.meta.prerender) {
6
+ setup(nuxtApp);
7
+ }
8
+ }
9
+ });
@@ -1,53 +1,5 @@
1
- import { parseURL } from "ufo";
2
- import { toValue } from "vue";
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(nuxtApp) {
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 { defu } from "defu";
2
- import { parseURL, withoutBase } from "ufo";
3
- import { createRouter as createRadixRouter, toRouteMatcher } from "radix3";
4
- import { getOgImagePath, isInternalRoute, useOgImageRuntimeConfig } from "../../shared.js";
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,3 @@
1
+ import type { NuxtApp } from 'nuxt/app';
2
+ export declare function ogImageCanonicalUrls(nuxtApp: NuxtApp): void;
3
+ export declare function routeRuleOgImage(nuxtApp: NuxtApp): void;
@@ -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 { resolveUnrefHeadInput } from "@unhead/vue";
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
  }
@@ -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, "__og-image__/image", pagePath, `og.${options.extension}`);
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"];
@@ -1,11 +1,11 @@
1
- import type { html } from 'satori-html';
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 { SharpOptions } from 'sharp';
4
+ import type { H3Error, H3Event } from 'h3';
7
5
  import type { NitroApp, NitroOptions } from 'nitropack';
8
- import type { OgImageComponents } from '#nuxt-og-image/components';
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
@@ -4,8 +4,4 @@ declare module '@nuxt/schema' {
4
4
  interface NuxtHooks extends ModuleHooks {}
5
5
  }
6
6
 
7
- declare module 'nuxt/schema' {
8
- interface NuxtHooks extends ModuleHooks {}
9
- }
10
-
11
7
  export { type ModuleHooks, type ModuleOptions, default } from './module.js'
package/dist/types.d.ts CHANGED
@@ -4,8 +4,4 @@ declare module '@nuxt/schema' {
4
4
  interface NuxtHooks extends ModuleHooks {}
5
5
  }
6
6
 
7
- declare module 'nuxt/schema' {
8
- interface NuxtHooks extends ModuleHooks {}
9
- }
10
-
11
7
  export { type ModuleHooks, type ModuleOptions, default } from './module'