nuxt-og-image 3.0.0-rc.3 → 3.0.0-rc.31
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 +4 -4
- package/dist/client/200.html +228 -15
- package/dist/client/404.html +228 -15
- package/dist/client/_nuxt/IconCSS.V7-3N1ew.js +1 -0
- package/dist/client/_nuxt/IconCSS.avVk0m4D.css +1 -0
- package/dist/client/_nuxt/abap.bJqzlTLD.js +816 -0
- package/dist/client/_nuxt/actionscript-3.NUzLYz6e.js +1 -0
- package/dist/client/_nuxt/ada.HSb8VHJ5.js +1 -0
- package/dist/client/_nuxt/andromeeda.TE0Toi4a.js +1 -0
- package/dist/client/_nuxt/angular-html.ulaXK71i.js +16 -0
- package/dist/client/_nuxt/angular-ts.CpB8xVpe.js +666 -0
- package/dist/client/_nuxt/apache.TpqIaH_y.js +1 -0
- package/dist/client/_nuxt/apex.rLr5RF8N.js +274 -0
- package/dist/client/_nuxt/apl.XB4V8Q_3.js +87 -0
- package/dist/client/_nuxt/applescript.uEUaUzem.js +38 -0
- package/dist/client/_nuxt/ara.yxVemEif.js +21 -0
- package/dist/client/_nuxt/asm.N3zWSyW8.js +1 -0
- package/dist/client/_nuxt/astro.5Up4Y-tq.js +1 -0
- package/dist/client/_nuxt/aurora-x.23vffHpO.js +1 -0
- package/dist/client/_nuxt/awk.tQAliBPt.js +1 -0
- package/dist/client/_nuxt/ayu-dark.09-XTo9D.js +1 -0
- package/dist/client/_nuxt/ballerina.j08zL6tL.js +62 -0
- package/dist/client/_nuxt/bat.4hprCtpO.js +1 -0
- package/dist/client/_nuxt/beancount.B4bgLeBI.js +1 -0
- package/dist/client/_nuxt/berry.99Qqo7Pl.js +1 -0
- package/dist/client/_nuxt/bibtex.PUS4KD1G.js +1 -0
- package/dist/client/_nuxt/bicep.U1vZFTkg.js +1 -0
- package/dist/client/_nuxt/blade.dLd1FX1V.js +831 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/e8c2abb1-c2da-455e-a7e8-26f4f28b10f9.json +1 -0
- package/dist/client/_nuxt/c.1HqcaTLZ.js +81 -0
- package/dist/client/_nuxt/cadence.wPBjDAPG.js +1 -0
- package/dist/client/_nuxt/catppuccin-frappe.3zzElYQH.js +1 -0
- package/dist/client/_nuxt/catppuccin-latte.7_seQpm6.js +1 -0
- package/dist/client/_nuxt/catppuccin-macchiato.xyLZ1Mzm.js +1 -0
- package/dist/client/_nuxt/catppuccin-mocha.sKQhYBeR.js +1 -0
- package/dist/client/_nuxt/clarity.9V3ikNUm.js +1 -0
- package/dist/client/_nuxt/clojure.m464_LIc.js +1 -0
- package/dist/client/_nuxt/cmake.YiKLaZ9A.js +1 -0
- package/dist/client/_nuxt/cobol.yHzQax91.js +1 -0
- package/dist/client/_nuxt/codeql.i7fhVOvX.js +1 -0
- package/dist/client/_nuxt/coffee.UjKhX0iS.js +100 -0
- package/dist/client/_nuxt/cpp.UIU91NPT.js +186 -0
- package/dist/client/_nuxt/crystal.ePodXjZr.js +25 -0
- package/dist/client/_nuxt/csharp.xHVQI8QI.js +756 -0
- package/dist/client/_nuxt/css.tuEqSfZX.js +505 -0
- package/dist/client/_nuxt/csv.REIP-dDb.js +1 -0
- package/dist/client/_nuxt/cue.ts9p4IYJ.js +1 -0
- package/dist/client/_nuxt/cypher.y2dXjvht.js +1 -0
- package/dist/client/_nuxt/d.91KOtcJM.js +1 -0
- package/dist/client/_nuxt/dark-plus.kgh98KCl.js +1 -0
- package/dist/client/_nuxt/dart.ATU8nP6d.js +1 -0
- package/dist/client/_nuxt/dax.M4oDHFBw.js +29 -0
- package/dist/client/_nuxt/diff.-l9-nN5b.js +1 -0
- package/dist/client/_nuxt/docker.FKXxym4E.js +1 -0
- package/dist/client/_nuxt/dracula-soft.E92bUq8i.js +1 -0
- package/dist/client/_nuxt/dracula.mNVTF5-9.js +1 -0
- package/dist/client/_nuxt/dream-maker.5lPMrnJr.js +52 -0
- package/dist/client/_nuxt/elixir.dYoE9A9d.js +17 -0
- package/dist/client/_nuxt/elm.AR6G1sGv.js +1 -0
- package/dist/client/_nuxt/entry.DjkITzvC.css +1 -0
- package/dist/client/_nuxt/entry.LuO6Nylf.js +134 -0
- package/dist/client/_nuxt/erb.vCu37omy.js +1 -0
- package/dist/client/_nuxt/erlang._Br9gip-.js +1 -0
- package/dist/client/_nuxt/{error-404.b7c0506a.js → error-404.DE_aZn4X.js} +1 -1
- package/dist/client/_nuxt/error-404.DkXpI38i.css +1 -0
- package/dist/client/_nuxt/{error-500.c45b2f29.js → error-500.4nIEY5y_.js} +1 -1
- package/dist/client/_nuxt/fish.k6NZEVUm.js +5 -0
- package/dist/client/_nuxt/fortran-fixed-form.5oVt_150.js +1 -0
- package/dist/client/_nuxt/fortran-free-form.l6j6vfmD.js +1 -0
- package/dist/client/_nuxt/fsharp.5TASvPJ1.js +1 -0
- package/dist/client/_nuxt/gdresource.7GKJFf55.js +1 -0
- package/dist/client/_nuxt/gdscript.E1_SGClP.js +44 -0
- package/dist/client/_nuxt/gdshader.6pjKCTQy.js +1 -0
- package/dist/client/_nuxt/gherkin.hgsyILVZ.js +1 -0
- package/dist/client/_nuxt/git-commit.RtAxFnK2.js +1 -0
- package/dist/client/_nuxt/git-rebase.-_3Z3F37.js +1 -0
- package/dist/client/_nuxt/github-dark-dimmed.yDYFqRVv.js +1 -0
- package/dist/client/_nuxt/github-dark.WrpzPehD.js +1 -0
- package/dist/client/_nuxt/github-light.QjB713Ax.js +1 -0
- package/dist/client/_nuxt/glimmer-js.8faD3vw8.js +13 -0
- package/dist/client/_nuxt/glimmer-ts.I8Eofu1P.js +13 -0
- package/dist/client/_nuxt/glsl.yLv_V-GM.js +1 -0
- package/dist/client/_nuxt/gnuplot.fIlAWhXw.js +266 -0
- package/dist/client/_nuxt/go.U2NlzxIl.js +1 -0
- package/dist/client/_nuxt/graphql.aYTh5yPU.js +4 -0
- package/dist/client/_nuxt/groovy.Z1Lrhk2B.js +37 -0
- package/dist/client/_nuxt/hack.9pFjhnG2.js +86 -0
- package/dist/client/_nuxt/haml.DYCf5dhF.js +1 -0
- package/dist/client/_nuxt/handlebars.Z9TIkDUw.js +1 -0
- package/dist/client/_nuxt/haskell.HW0BBkRd.js +559 -0
- package/dist/client/_nuxt/hcl.M9siRbiv.js +1 -0
- package/dist/client/_nuxt/hjson.fLk7JbZa.js +50 -0
- package/dist/client/_nuxt/hlsl.Do_j-o-7.js +1 -0
- package/dist/client/_nuxt/html.ZVb9jHrO.js +74 -0
- package/dist/client/_nuxt/http.McgS7Vpm.js +1 -0
- package/dist/client/_nuxt/imba.guICF3zN.js +223 -0
- package/dist/client/_nuxt/ini.T6bxBy5-.js +1 -0
- package/dist/client/_nuxt/java.tY-NU26U.js +68 -0
- package/dist/client/_nuxt/javascript.JMZ6uy5M.js +699 -0
- package/dist/client/_nuxt/jinja.H2a5aKFq.js +1 -0
- package/dist/client/_nuxt/jison.hEN1Pilr.js +1 -0
- package/dist/client/_nuxt/json.xL80yL3n.js +25 -0
- package/dist/client/_nuxt/json5.NRuQoh_0.js +17 -0
- package/dist/client/_nuxt/jsonc.Bb1R3obU.js +25 -0
- package/dist/client/_nuxt/jsonl.Yjg0VwMG.js +25 -0
- package/dist/client/_nuxt/jsonnet.WK26vH-O.js +1 -0
- package/dist/client/_nuxt/jssm.eioTUq4-.js +1 -0
- package/dist/client/_nuxt/jsx.3LZ_BoLB.js +699 -0
- package/dist/client/_nuxt/julia.zN5MNt1V.js +9 -0
- package/dist/client/_nuxt/kotlin.1iwCeGA4.js +1 -0
- package/dist/client/_nuxt/kusto.UpRCclYC.js +1 -0
- package/dist/client/_nuxt/latex.Pwsy_OsJ.js +3 -0
- package/dist/client/_nuxt/less.Mq8TrjER.js +159 -0
- package/dist/client/_nuxt/light-plus.TzXGjDsL.js +1 -0
- package/dist/client/_nuxt/liquid.UuwAmqmc.js +14 -0
- package/dist/client/_nuxt/lisp.iIZdsWzX.js +1 -0
- package/dist/client/_nuxt/logo.WuHqTpFy.js +1 -0
- package/dist/client/_nuxt/lua.OGbZEs3U.js +1 -0
- package/dist/client/_nuxt/make.8zIAVqFD.js +1 -0
- package/dist/client/_nuxt/markdown.Y8p9X7h3.js +129 -0
- package/dist/client/_nuxt/marko.gbQhFTQa.js +8 -0
- package/dist/client/_nuxt/material-theme-darker.e1lAwchJ.js +1 -0
- package/dist/client/_nuxt/material-theme-lighter.y77yPuAI.js +1 -0
- package/dist/client/_nuxt/material-theme-ocean.oIMAIpse.js +1 -0
- package/dist/client/_nuxt/material-theme-palenight.Z44VU5rQ.js +1 -0
- package/dist/client/_nuxt/material-theme.49YjOoAR.js +1 -0
- package/dist/client/_nuxt/matlab.LaB98_jd.js +70 -0
- package/dist/client/_nuxt/mdc.NowVT77H.js +76 -0
- package/dist/client/_nuxt/mdx.VhCSg2DJ.js +1 -0
- package/dist/client/_nuxt/mermaid.WuNnVULj.js +1 -0
- package/dist/client/_nuxt/min-dark._Ja8ZF5C.js +1 -0
- package/dist/client/_nuxt/min-light.N1m_6E3S.js +1 -0
- package/dist/client/_nuxt/mojo.zLNDSfD9.js +519 -0
- package/dist/client/_nuxt/monokai.WLw4Glvg.js +1 -0
- package/dist/client/_nuxt/narrat.KYi2rZr0.js +7 -0
- package/dist/client/_nuxt/nextflow.lYJjOZ_l.js +1 -0
- package/dist/client/_nuxt/nginx.CrBM8z2W.js +1 -0
- package/dist/client/_nuxt/night-owl.GWZK5Ce7.js +1 -0
- package/dist/client/_nuxt/nim.16czfBCm.js +1 -0
- package/dist/client/_nuxt/nix.z3u_V08Q.js +1 -0
- package/dist/client/_nuxt/nord.1NrVtx79.js +1 -0
- package/dist/client/_nuxt/nushell.GDk9yul-.js +1 -0
- package/dist/client/_nuxt/objective-c.Eci2Q5FN.js +109 -0
- package/dist/client/_nuxt/objective-cpp.nGsV46Zk.js +239 -0
- package/dist/client/_nuxt/ocaml.oQRvlYTD.js +1 -0
- package/dist/client/_nuxt/one-dark-pro.qlkgvdEn.js +1 -0
- package/dist/client/_nuxt/onig.mBJmD8D5.js +1 -0
- package/dist/client/_nuxt/pascal.aIRIFbih.js +1 -0
- package/dist/client/_nuxt/perl._x09KDDb.js +1 -0
- package/dist/client/_nuxt/php.2PDLwZAX.js +771 -0
- package/dist/client/_nuxt/plsql.vhhXsReo.js +1 -0
- package/dist/client/_nuxt/poimandres.oZrO-I17.js +1 -0
- package/dist/client/_nuxt/postcss.57yKeRpx.js +1 -0
- package/dist/client/_nuxt/powerquery.wBQvr9E-.js +1 -0
- package/dist/client/_nuxt/powershell.6Y_bsqLY.js +1 -0
- package/dist/client/_nuxt/prisma.fG9Ut-9i.js +1 -0
- package/dist/client/_nuxt/prolog.vggnm0Hd.js +1 -0
- package/dist/client/_nuxt/proto.yigfBmiL.js +1 -0
- package/dist/client/_nuxt/pug.ieZS468c.js +1 -0
- package/dist/client/_nuxt/puppet.NqXa_cO1.js +1 -0
- package/dist/client/_nuxt/purescript.NA5qsvV2.js +7 -0
- package/dist/client/_nuxt/python.V9Nu427R.js +518 -0
- package/dist/client/_nuxt/r.xMXDrvl2.js +1 -0
- package/dist/client/_nuxt/raku.NSWyGF40.js +1 -0
- package/dist/client/_nuxt/razor.wPI2afgP.js +40 -0
- package/dist/client/_nuxt/red.sV5NnIRC.js +1 -0
- package/dist/client/_nuxt/reg.Dr-lXfN9.js +1 -0
- package/dist/client/_nuxt/rel.vATIbX_E.js +1 -0
- package/dist/client/_nuxt/riscv.L73dAZEB.js +13 -0
- package/dist/client/_nuxt/rose-pine-dawn.qPi4euik.js +1 -0
- package/dist/client/_nuxt/rose-pine-moon.Im6VgKOx.js +1 -0
- package/dist/client/_nuxt/rose-pine._tQyNI4L.js +1 -0
- package/dist/client/_nuxt/rst.Nzb5IGfi.js +1 -0
- package/dist/client/_nuxt/ruby.oOCDDplm.js +80 -0
- package/dist/client/_nuxt/rust.yNm59Dur.js +1 -0
- package/dist/client/_nuxt/sas.fTu4QUYF.js +1 -0
- package/dist/client/_nuxt/sass.URKSWxt9.js +2 -0
- package/dist/client/_nuxt/scala.7DKpDMtV.js +5 -0
- package/dist/client/_nuxt/scheme.S0VUhbaV.js +136 -0
- package/dist/client/_nuxt/scss.9u5wOjnF.js +90 -0
- package/dist/client/_nuxt/shaderlab.MYTNW71C.js +1 -0
- package/dist/client/_nuxt/shellscript.82BvnTib.js +4 -0
- package/dist/client/_nuxt/shellsession.e2TODbDv.js +1 -0
- package/dist/client/_nuxt/slack-dark.1ZggNzwg.js +1 -0
- package/dist/client/_nuxt/slack-ochin.IcMt0x71.js +1 -0
- package/dist/client/_nuxt/smalltalk.ymyryZ3T.js +1 -0
- package/dist/client/_nuxt/solarized-dark.3DcwRX9o.js +1 -0
- package/dist/client/_nuxt/solarized-light.iUVMuJ2F.js +1 -0
- package/dist/client/_nuxt/solidity.rGqtk2dD.js +1 -0
- package/dist/client/_nuxt/sparql.b6B4dWwT.js +1 -0
- package/dist/client/_nuxt/splunk.OYnOZZCZ.js +1 -0
- package/dist/client/_nuxt/sql.KWFjTZGI.js +21 -0
- package/dist/client/_nuxt/ssh-config.jdYjUr9x.js +1 -0
- package/dist/client/_nuxt/stata.cF_ucIcM.js +3 -0
- package/dist/client/_nuxt/stylus.sPHLw37c.js +15 -0
- package/dist/client/_nuxt/svelte.j-bqdsch.js +1 -0
- package/dist/client/_nuxt/swift.YwiPyWKn.js +544 -0
- package/dist/client/_nuxt/synthwave-84.QD7ZGwpp.js +1 -0
- package/dist/client/_nuxt/system-verilog.gwJe9XJI.js +9 -0
- package/dist/client/_nuxt/tasl.IM3fg-4x.js +1 -0
- package/dist/client/_nuxt/tcl.h_zrCUh3.js +1 -0
- package/dist/client/_nuxt/tex.uNByjuDB.js +1 -0
- package/dist/client/_nuxt/tokyo-night.3j08uV2M.js +1 -0
- package/dist/client/_nuxt/toml.p_xIKQcU.js +69 -0
- package/dist/client/_nuxt/tsx.7LxggtAE.js +699 -0
- package/dist/client/_nuxt/turtle.qvOLXpiq.js +1 -0
- package/dist/client/_nuxt/twig.p6WenPmw.js +40 -0
- package/dist/client/_nuxt/typescript.HpdcmTOD.js +666 -0
- package/dist/client/_nuxt/v.BcVLQyAr.js +1 -0
- package/dist/client/_nuxt/vanilla-picker.P0dws0ou.js +8 -0
- package/dist/client/_nuxt/vb.nfm3ZogP.js +1 -0
- package/dist/client/_nuxt/verilog.32GaFvLA.js +1 -0
- package/dist/client/_nuxt/vhdl.BgfvI7C9.js +515 -0
- package/dist/client/_nuxt/viml.Ob-szSvk.js +1 -0
- package/dist/client/_nuxt/vitesse-black.uLlG6AUB.js +1 -0
- package/dist/client/_nuxt/vitesse-dark.5VceXvs6.js +1 -0
- package/dist/client/_nuxt/vitesse-light.HOMMxGxw.js +1 -0
- package/dist/client/_nuxt/vue-html.TGyjH-sv.js +1 -0
- package/dist/client/_nuxt/vue.AKvPdve9.js +6 -0
- package/dist/client/_nuxt/vyper.0ItMHLZu.js +575 -0
- package/dist/client/_nuxt/wasm.5qeU6UJI.js +1 -0
- package/dist/client/_nuxt/wenyan.gl1zQYA8.js +1 -0
- package/dist/client/_nuxt/wgsl.KpVp-DWl.js +1 -0
- package/dist/client/_nuxt/wolfram.K_QzNdW-.js +1 -0
- package/dist/client/_nuxt/xml.GygmfNh9.js +1 -0
- package/dist/client/_nuxt/xsl.TptR0G-3.js +1 -0
- package/dist/client/_nuxt/yaml.zytfnWoA.js +200 -0
- package/dist/client/_nuxt/zenscript.htRIWiQY.js +2 -0
- package/dist/client/_nuxt/zig.VzlkOal1.js +1 -0
- package/dist/client/index.html +228 -15
- package/dist/module.d.mts +10 -3
- package/dist/module.d.ts +10 -3
- package/dist/module.json +2 -2
- package/dist/module.mjs +197 -121
- package/dist/runtime/nitro/og-image/bindings/chromium/chrome-launcher.mjs +9 -0
- package/dist/runtime/nitro/og-image/bindings/chromium/on-demand.d.ts +2 -0
- package/dist/runtime/nitro/og-image/bindings/chromium/on-demand.mjs +36 -0
- package/dist/runtime/nitro/og-image/bindings/chromium/playwright.d.ts +2 -0
- package/dist/runtime/nitro/og-image/bindings/chromium/playwright.mjs +6 -0
- package/dist/runtime/nitro/og-image/bindings/css-inline/node.d.ts +8 -0
- package/dist/runtime/nitro/og-image/bindings/css-inline/node.mjs +7 -0
- package/dist/runtime/nitro/og-image/bindings/css-inline/wasm-fs.d.ts +8 -0
- package/dist/runtime/nitro/og-image/bindings/css-inline/wasm-fs.mjs +8 -0
- package/dist/runtime/nitro/og-image/bindings/css-inline/wasm.d.ts +8 -0
- package/dist/runtime/nitro/og-image/bindings/css-inline/wasm.mjs +8 -0
- package/dist/runtime/{core → nitro/og-image}/bindings/resvg/wasm-fs.mjs +1 -1
- package/dist/runtime/{core → nitro/og-image}/bindings/resvg/wasm.mjs +1 -1
- package/dist/runtime/{core → nitro/og-image}/bindings/satori/wasm-fs.mjs +1 -1
- package/dist/runtime/{core → nitro/og-image}/bindings/satori/wasm.mjs +1 -1
- package/dist/runtime/nitro/og-image/cache.d.ts +7 -0
- package/dist/runtime/{core/cache/htmlPayload.mjs → nitro/og-image/cache.mjs} +3 -0
- package/dist/runtime/{core/renderers → nitro/og-image}/chromium/screenshot.mjs +1 -1
- package/dist/runtime/nitro/og-image/context.d.ts +5 -0
- package/dist/runtime/nitro/og-image/context.mjs +177 -0
- package/dist/runtime/nitro/og-image/instances.d.ts +2 -0
- package/dist/runtime/nitro/og-image/instances.mjs +10 -0
- package/dist/runtime/{core/font/fetch.d.ts → nitro/og-image/satori/font.d.ts} +1 -1
- package/dist/runtime/nitro/og-image/satori/font.mjs +32 -0
- package/dist/runtime/{core/renderers → nitro/og-image}/satori/instances.d.ts +0 -2
- package/dist/runtime/{core/renderers → nitro/og-image}/satori/instances.mjs +2 -11
- package/dist/runtime/nitro/og-image/satori/plugins/encoding.mjs +17 -0
- package/dist/runtime/nitro/og-image/satori/plugins/imageSrc.mjs +82 -0
- package/dist/runtime/{core/renderers/satori/index.mjs → nitro/og-image/satori/renderer.mjs} +28 -15
- package/dist/runtime/{core/html/applyEmojis.d.ts → nitro/og-image/satori/transforms/emojis.d.ts} +3 -1
- package/dist/runtime/{core/html/applyEmojis.mjs → nitro/og-image/satori/transforms/emojis.mjs} +6 -2
- package/dist/runtime/{core/html/applyInlineCss.d.ts → nitro/og-image/satori/transforms/inlineCss.d.ts} +1 -1
- package/dist/runtime/nitro/og-image/satori/transforms/inlineCss.mjs +39 -0
- package/dist/runtime/{core/renderers → nitro/og-image}/satori/vnodes.mjs +7 -5
- package/dist/runtime/nitro/og-image/templates/html.d.ts +2 -0
- package/dist/runtime/{core/html/devIframeTemplate.mjs → nitro/og-image/templates/html.mjs} +17 -9
- package/dist/runtime/nitro/plugins/nuxt-content.mjs +7 -4
- package/dist/runtime/nitro/plugins/prerender.d.ts +1 -1
- package/dist/runtime/nitro/plugins/prerender.mjs +8 -16
- package/dist/runtime/{server/routes/__og-image__ → nitro/routes}/debug.json.d.ts +1 -5
- package/dist/runtime/{server/routes/__og-image__ → nitro/routes}/debug.json.mjs +1 -7
- package/dist/runtime/{server/routes/__og-image__/font-[name]-[weight].[extension].mjs → nitro/routes/font.mjs} +22 -3
- package/dist/runtime/{server/routes/__og-image__ → nitro/routes}/image.mjs +9 -12
- package/dist/runtime/nitro/tsconfig.json +3 -0
- package/dist/runtime/{cache.d.ts → nitro/util/cache.d.ts} +1 -1
- package/dist/runtime/nitro/util/encoding.d.ts +3 -0
- package/dist/runtime/nitro/util/encoding.mjs +15 -0
- package/dist/runtime/nitro/util/kit.d.ts +6 -0
- package/dist/runtime/nitro/util/kit.mjs +32 -0
- package/dist/runtime/{components → nuxt/components}/OgImage/OgImage.d.ts +2 -2
- package/dist/runtime/{components → nuxt/components}/OgImage/OgImageScreenshot.d.ts +2 -2
- package/dist/runtime/{components → nuxt/components}/Templates/Community/NuxtSeo.vue +2 -2
- package/dist/runtime/{components → nuxt/components}/Templates/Community/UnJs.vue +2 -2
- package/dist/runtime/{composables → nuxt/composables}/defineOgImage.d.ts +1 -1
- package/dist/runtime/{composables → nuxt/composables}/defineOgImage.mjs +6 -11
- package/dist/runtime/{composables → nuxt/composables}/defineOgImageComponent.d.ts +1 -1
- package/dist/runtime/{composables → nuxt/composables}/defineOgImageScreenshot.d.ts +1 -1
- package/dist/runtime/nuxt/composables/mock.d.ts +0 -0
- package/dist/runtime/nuxt/composables/mock.mjs +6 -0
- package/dist/runtime/nuxt/plugins/og-image-canonical-urls.server.mjs +10 -3
- package/dist/runtime/nuxt/plugins/route-rule-og-image.server.mjs +1 -1
- package/dist/runtime/nuxt/utils.d.ts +2 -1
- package/dist/runtime/nuxt/utils.mjs +5 -3
- package/dist/runtime/{utils.pure.d.ts → pure.d.ts} +3 -0
- package/dist/runtime/{utils.pure.mjs → pure.mjs} +19 -1
- package/dist/runtime/{utils.d.ts → shared.d.ts} +1 -1
- package/dist/runtime/{utils.mjs → shared.mjs} +1 -1
- package/dist/runtime/types.d.ts +9 -3
- package/dist/types.d.mts +2 -2
- package/package.json +71 -46
- package/dist/client/_nuxt/IconCSS.a9e1bda0.js +0 -1
- package/dist/client/_nuxt/IconCSS.f0b56d3e.css +0 -1
- package/dist/client/_nuxt/builds/meta/f6f30fc8-72d3-4090-90f8-10aeee14e041.json +0 -1
- package/dist/client/_nuxt/entry.a30f63d0.css +0 -1
- package/dist/client/_nuxt/entry.dd086114.js +0 -108
- package/dist/client/_nuxt/error-404.b751fa02.css +0 -1
- package/dist/client/_nuxt/vanilla-picker-NKbIFE8h.23409a58.js +0 -8
- package/dist/runtime/core/bindings/chromium/node.mjs +0 -33
- package/dist/runtime/core/bindings/css-inline/node.d.ts +0 -2
- package/dist/runtime/core/bindings/css-inline/node.mjs +0 -2
- package/dist/runtime/core/cache/emojis.d.ts +0 -1
- package/dist/runtime/core/cache/emojis.mjs +0 -5
- package/dist/runtime/core/cache/fonts.d.ts +0 -3
- package/dist/runtime/core/cache/fonts.mjs +0 -6
- package/dist/runtime/core/cache/htmlPayload.d.ts +0 -5
- package/dist/runtime/core/cache/prerender.d.ts +0 -2
- package/dist/runtime/core/cache/prerender.mjs +0 -5
- package/dist/runtime/core/env/assets.d.ts +0 -1
- package/dist/runtime/core/env/assets.mjs +0 -11
- package/dist/runtime/core/font/fetch.mjs +0 -36
- package/dist/runtime/core/html/applyInlineCss.mjs +0 -32
- package/dist/runtime/core/html/devIframeTemplate.d.ts +0 -2
- package/dist/runtime/core/html/fetchIsland.d.ts +0 -3
- package/dist/runtime/core/html/fetchIsland.mjs +0 -17
- package/dist/runtime/core/options/extract.d.ts +0 -3
- package/dist/runtime/core/options/extract.mjs +0 -49
- package/dist/runtime/core/options/fetch.d.ts +0 -3
- package/dist/runtime/core/options/fetch.mjs +0 -32
- package/dist/runtime/core/renderers/satori/plugins/encoding.mjs +0 -8
- package/dist/runtime/core/renderers/satori/plugins/imageSrc.mjs +0 -75
- package/dist/runtime/core/utils/resolveRendererContext.d.ts +0 -3
- package/dist/runtime/core/utils/resolveRendererContext.mjs +0 -96
- package/dist/runtime/nitro/utils.d.ts +0 -2
- package/dist/runtime/nitro/utils.mjs +0 -17
- package/dist/runtime/server/assets/inter-latin-ext-400-normal.woff +0 -0
- package/dist/runtime/server/assets/inter-latin-ext-700-normal.woff +0 -0
- /package/dist/client/_nuxt/{error-500.69009e70.css → error-500.SLhS9LVu.css} +0 -0
- /package/dist/runtime/{core/bindings/chromium/node.d.ts → nitro/og-image/bindings/chromium/chrome-launcher.d.ts} +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/resvg/node.d.ts +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/resvg/node.mjs +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/resvg/wasm-fs.d.ts +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/resvg/wasm.d.ts +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/satori/node.d.ts +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/satori/node.mjs +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/satori/wasm-fs.d.ts +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/satori/wasm.d.ts +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/sharp/node.d.ts +0 -0
- /package/dist/runtime/{core → nitro/og-image}/bindings/sharp/node.mjs +0 -0
- /package/dist/runtime/{core/renderers/chromium/index.d.ts → nitro/og-image/chromium/renderer.d.ts} +0 -0
- /package/dist/runtime/{core/renderers/chromium/index.mjs → nitro/og-image/chromium/renderer.mjs} +0 -0
- /package/dist/runtime/{core/renderers → nitro/og-image}/chromium/screenshot.d.ts +0 -0
- /package/dist/runtime/{core/renderers → nitro/og-image}/satori/plugins/emojis.d.ts +0 -0
- /package/dist/runtime/{core/renderers → nitro/og-image}/satori/plugins/emojis.mjs +0 -0
- /package/dist/runtime/{core/renderers → nitro/og-image}/satori/plugins/encoding.d.ts +0 -0
- /package/dist/runtime/{core/renderers → nitro/og-image}/satori/plugins/flex.d.ts +0 -0
- /package/dist/runtime/{core/renderers → nitro/og-image}/satori/plugins/flex.mjs +0 -0
- /package/dist/runtime/{core/renderers → nitro/og-image}/satori/plugins/imageSrc.d.ts +0 -0
- /package/dist/runtime/{core/renderers → nitro/og-image}/satori/plugins/twClasses.d.ts +0 -0
- /package/dist/runtime/{core/renderers → nitro/og-image}/satori/plugins/twClasses.mjs +0 -0
- /package/dist/runtime/{core/renderers → nitro/og-image}/satori/plugins/unocss.d.ts +0 -0
- /package/dist/runtime/{core/renderers → nitro/og-image}/satori/plugins/unocss.mjs +0 -0
- /package/dist/runtime/{core/renderers/satori/index.d.ts → nitro/og-image/satori/renderer.d.ts} +0 -0
- /package/dist/runtime/{core/renderers → nitro/og-image}/satori/utils.d.ts +0 -0
- /package/dist/runtime/{core/renderers → nitro/og-image}/satori/utils.mjs +0 -0
- /package/dist/runtime/{core/renderers → nitro/og-image}/satori/vnodes.d.ts +0 -0
- /package/dist/runtime/{server/routes/__og-image__/font-[name]-[weight].[extension].d.ts → nitro/routes/font.d.ts} +0 -0
- /package/dist/runtime/{server/routes/__og-image__ → nitro/routes}/image.d.ts +0 -0
- /package/dist/runtime/{cache.mjs → nitro/util/cache.mjs} +0 -0
- /package/dist/runtime/{core/utils → nitro/util}/wasm.d.ts +0 -0
- /package/dist/runtime/{core/utils → nitro/util}/wasm.mjs +0 -0
- /package/dist/runtime/{components → nuxt/components}/OgImage/OgImage.mjs +0 -0
- /package/dist/runtime/{components → nuxt/components}/OgImage/OgImageScreenshot.mjs +0 -0
- /package/dist/runtime/{components → nuxt/components}/Templates/Community/BrandedLogo.vue +0 -0
- /package/dist/runtime/{components → nuxt/components}/Templates/Community/Nuxt.vue +0 -0
- /package/dist/runtime/{components → nuxt/components}/Templates/Community/Pergel.vue +0 -0
- /package/dist/runtime/{components → nuxt/components}/Templates/Community/SimpleBlog.vue +0 -0
- /package/dist/runtime/{components → nuxt/components}/Templates/Community/Wave.vue +0 -0
- /package/dist/runtime/{components → nuxt/components}/Templates/Community/WithEmoji.vue +0 -0
- /package/dist/runtime/{composables → nuxt/composables}/defineOgImageComponent.mjs +0 -0
- /package/dist/runtime/{composables → nuxt/composables}/defineOgImageScreenshot.mjs +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { html as convertHtmlToSatori } from "satori-html";
|
|
2
|
-
import { fetchIsland } from "../../
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { fetchIsland } from "../../util/kit.mjs";
|
|
3
|
+
import { htmlDecodeQuotes } from "../../util/encoding.mjs";
|
|
4
|
+
import { applyInlineCss } from "./transforms/inlineCss.mjs";
|
|
5
|
+
import { applyEmojis } from "./transforms/emojis.mjs";
|
|
5
6
|
import { walkSatoriTree } from "./utils.mjs";
|
|
6
7
|
import unocss from "./plugins/unocss.mjs";
|
|
7
8
|
import emojis from "./plugins/emojis.mjs";
|
|
@@ -12,12 +13,13 @@ import encoding from "./plugins/encoding.mjs";
|
|
|
12
13
|
export async function createVNodes(ctx) {
|
|
13
14
|
let html = ctx.options.html;
|
|
14
15
|
if (!html) {
|
|
15
|
-
const island = await fetchIsland(ctx);
|
|
16
|
+
const island = await fetchIsland(ctx.e, ctx.options.component, typeof ctx.options.props !== "undefined" ? ctx.options.props : ctx.options);
|
|
17
|
+
island.html = htmlDecodeQuotes(island.html);
|
|
16
18
|
await applyInlineCss(ctx, island);
|
|
17
19
|
await applyEmojis(ctx, island);
|
|
18
20
|
html = island.html;
|
|
19
21
|
}
|
|
20
|
-
const template = `<div
|
|
22
|
+
const template = `<div style="position: relative; display: flex; margin: 0 auto; width: ${ctx.options.width}px; height: ${ctx.options.height}px; overflow: hidden;">${html}</div>`;
|
|
21
23
|
const satoriTree = convertHtmlToSatori(template);
|
|
22
24
|
await walkSatoriTree(ctx, satoriTree, [
|
|
23
25
|
unocss,
|
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
import { createHeadCore } from "@unhead/vue";
|
|
2
2
|
import { renderSSRHead } from "@unhead/ssr";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { fetchIsland } from "
|
|
3
|
+
import { createError } from "h3";
|
|
4
|
+
import { normaliseFontInput, useOgImageRuntimeConfig } from "../../../shared.mjs";
|
|
5
|
+
import { fetchIsland } from "../../util/kit.mjs";
|
|
6
|
+
import { applyEmojis } from "../satori/transforms/emojis.mjs";
|
|
6
7
|
import { theme } from "#nuxt-og-image/unocss-config.mjs";
|
|
7
|
-
export async function
|
|
8
|
+
export async function html(ctx) {
|
|
8
9
|
const { options } = ctx;
|
|
9
10
|
const { fonts } = useOgImageRuntimeConfig();
|
|
10
|
-
|
|
11
|
+
if (!options.component) {
|
|
12
|
+
throw createError({
|
|
13
|
+
statusCode: 500,
|
|
14
|
+
statusMessage: `[Nuxt OG Image] Rendering an invalid component. Received options: ${JSON.stringify(options)}.`
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
const island = await fetchIsland(ctx.e, ctx.options.component, typeof ctx.options.props !== "undefined" ? ctx.options.props : ctx.options);
|
|
11
18
|
const head = createHeadCore();
|
|
12
19
|
head.push(island.head);
|
|
13
20
|
let defaultFontFamily = "sans-serif";
|
|
14
|
-
const
|
|
21
|
+
const normalisedFonts = normaliseFontInput([...options.fonts || [], ...fonts]);
|
|
22
|
+
const firstFont = normalisedFonts[0];
|
|
15
23
|
if (firstFont)
|
|
16
24
|
defaultFontFamily = firstFont.name;
|
|
17
25
|
await applyEmojis(ctx, island);
|
|
18
|
-
let
|
|
26
|
+
let html2 = island.html;
|
|
19
27
|
const googleFonts = {};
|
|
20
28
|
fonts.filter((font) => !font.path).forEach((font) => {
|
|
21
29
|
if (!googleFonts[font.name])
|
|
@@ -98,11 +106,11 @@ svg[data-emoji] {
|
|
|
98
106
|
})
|
|
99
107
|
]
|
|
100
108
|
});
|
|
101
|
-
|
|
109
|
+
html2 = html2.replaceAll(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "");
|
|
102
110
|
const headChunk = await renderSSRHead(head);
|
|
103
111
|
return `<!DOCTYPE html>
|
|
104
112
|
<html ${headChunk.htmlAttrs}>
|
|
105
113
|
<head>${headChunk.headTags}</head>
|
|
106
|
-
<body ${headChunk.bodyAttrs}>${headChunk.bodyTagsOpen}<div data-v-inspector-ignore="true" style="position: relative; display: flex; margin: 0 auto; width: ${options.width}px; height: ${options.height}px; overflow: hidden;">${
|
|
114
|
+
<body ${headChunk.bodyAttrs}>${headChunk.bodyTagsOpen}<div data-v-inspector-ignore="true" style="position: relative; display: flex; margin: 0 auto; width: ${options.width}px; height: ${options.height}px; overflow: hidden;">${html2}</div>${headChunk.bodyTags}</body>
|
|
107
115
|
</html>`;
|
|
108
116
|
}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { defineNitroPlugin } from "nitropack/dist/runtime/plugin";
|
|
2
2
|
import { defu } from "defu";
|
|
3
|
-
import { getOgImagePath, useOgImageRuntimeConfig } from "../../
|
|
3
|
+
import { getOgImagePath, useOgImageRuntimeConfig } from "../../shared.mjs";
|
|
4
4
|
export default defineNitroPlugin((nitroApp) => {
|
|
5
|
+
const { isNuxtContentDocumentDriven, defaults } = useOgImageRuntimeConfig();
|
|
5
6
|
nitroApp.hooks.hook("content:file:afterParse", async (content) => {
|
|
6
7
|
if (content._draft || content._extension !== "md" || content._partial || content.indexable === false || content.index === false)
|
|
7
8
|
return;
|
|
8
|
-
|
|
9
|
+
let path = content.path;
|
|
10
|
+
if (isNuxtContentDocumentDriven)
|
|
11
|
+
path = content._path;
|
|
12
|
+
if (path && content.ogImage) {
|
|
9
13
|
const ogImageConfig = typeof content.ogImage === "object" ? content.ogImage : {};
|
|
10
|
-
const { defaults } = useOgImageRuntimeConfig();
|
|
11
14
|
const optionsWithDefault = defu(ogImageConfig, defaults);
|
|
12
|
-
const src = getOgImagePath(
|
|
15
|
+
const src = getOgImagePath(path, optionsWithDefault);
|
|
13
16
|
const payload = {
|
|
14
17
|
title: content.title,
|
|
15
18
|
excerpt: content.description || content.excerpt,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("nitropack").NitroAppPlugin;
|
|
1
|
+
declare const _default: import("nitropack/dist/runtime/plugin").NitroAppPlugin;
|
|
2
2
|
export default _default;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { parseURL
|
|
1
|
+
import { parseURL } from "ufo";
|
|
2
2
|
import { defineNitroPlugin } from "nitropack/dist/runtime/plugin";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { isInternalRoute } from "../../utils.pure.mjs";
|
|
8
|
-
import { resolvePathCacheKey } from "../utils.mjs";
|
|
9
|
-
import { useRuntimeConfig } from "#internal/nitro";
|
|
3
|
+
import { extractAndNormaliseOgImageOptions, resolvePathCacheKey } from "../og-image/context.mjs";
|
|
4
|
+
import { prerenderOptionsCache } from "../og-image/cache.mjs";
|
|
5
|
+
import { isInternalRoute } from "../../pure.mjs";
|
|
6
|
+
import { createNitroRouteRuleMatcher } from "../util/kit.mjs";
|
|
10
7
|
export default defineNitroPlugin(async (nitro) => {
|
|
11
8
|
if (!import.meta.prerender)
|
|
12
9
|
return;
|
|
@@ -15,14 +12,9 @@ export default defineNitroPlugin(async (nitro) => {
|
|
|
15
12
|
const path = parseURL(ctx.event.path).pathname;
|
|
16
13
|
if (isInternalRoute(path))
|
|
17
14
|
return;
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
);
|
|
22
|
-
const routeRules = defu({}, ..._routeRulesMatcher.matchAll(
|
|
23
|
-
withoutBase(path.split("?")[0], runtimeConfig.app.baseURL)
|
|
24
|
-
).reverse()).ogImage;
|
|
25
|
-
if (routeRules === false)
|
|
15
|
+
const routeRuleMatcher = createNitroRouteRuleMatcher();
|
|
16
|
+
const routeRules = routeRuleMatcher(path);
|
|
17
|
+
if (routeRules.ogImage === false)
|
|
26
18
|
return;
|
|
27
19
|
const options = extractAndNormaliseOgImageOptions([
|
|
28
20
|
head.join("\n"),
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<{
|
|
2
|
-
siteConfigUrl: {
|
|
3
|
-
value: any;
|
|
4
|
-
source: any;
|
|
5
|
-
};
|
|
6
2
|
componentNames: any;
|
|
7
|
-
runtimeConfig: import("
|
|
3
|
+
runtimeConfig: import("../../types").OgImageRuntimeConfig;
|
|
8
4
|
compatibility: any;
|
|
9
5
|
}>>;
|
|
10
6
|
export default _default;
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import { defineEventHandler, setHeader } from "h3";
|
|
2
|
-
import { useOgImageRuntimeConfig } from "
|
|
3
|
-
import { useSiteConfig } from "#imports";
|
|
2
|
+
import { useOgImageRuntimeConfig } from "../../shared.mjs";
|
|
4
3
|
import compatibility from "#nuxt-og-image/compatibility";
|
|
5
4
|
import { componentNames } from "#nuxt-og-image/component-names.mjs";
|
|
6
5
|
export default defineEventHandler(async (e) => {
|
|
7
6
|
setHeader(e, "Content-Type", "application/json");
|
|
8
7
|
const runtimeConfig = useOgImageRuntimeConfig();
|
|
9
|
-
const siteConfig = await useSiteConfig(e, { debug: true });
|
|
10
8
|
return {
|
|
11
|
-
siteConfigUrl: {
|
|
12
|
-
value: siteConfig.url,
|
|
13
|
-
source: siteConfig._context.url || "unknown"
|
|
14
|
-
},
|
|
15
9
|
componentNames,
|
|
16
10
|
runtimeConfig,
|
|
17
11
|
compatibility
|
|
@@ -1,10 +1,29 @@
|
|
|
1
|
-
import { createError, defineEventHandler, proxyRequest, sendRedirect } from "h3";
|
|
1
|
+
import { createError, defineEventHandler, getQuery, proxyRequest, sendRedirect } from "h3";
|
|
2
2
|
import { parseURL } from "ufo";
|
|
3
|
+
import { normaliseFontInput, useOgImageRuntimeConfig } from "../../shared.mjs";
|
|
3
4
|
export default defineEventHandler(async (e) => {
|
|
4
5
|
const path = parseURL(e.path).pathname;
|
|
5
|
-
const [
|
|
6
|
-
if (!
|
|
6
|
+
const [_name, _weight] = path.split("/font/")[1].split(".")[0].split("/");
|
|
7
|
+
if (!_name || !_weight)
|
|
7
8
|
return "Provide a font name and weight";
|
|
9
|
+
const name = _name[0].toUpperCase() + _name.slice(1);
|
|
10
|
+
const weight = Math.round(Number.parseInt(_weight) / 100) * 100;
|
|
11
|
+
const config = useOgImageRuntimeConfig();
|
|
12
|
+
const normalisedFonts = normaliseFontInput(config.fonts);
|
|
13
|
+
let font;
|
|
14
|
+
if (typeof getQuery(e).font === "string")
|
|
15
|
+
font = JSON.parse(getQuery(e).font);
|
|
16
|
+
if (!font) {
|
|
17
|
+
font = normalisedFonts.find((font2) => {
|
|
18
|
+
return font2.name.toLowerCase() === name.toLowerCase() && weight === Number(font2.weight);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
if (!font) {
|
|
22
|
+
return createError({
|
|
23
|
+
statusCode: 404,
|
|
24
|
+
statusMessage: `[Nuxt OG Image] Font ${name}:${weight} not found`
|
|
25
|
+
});
|
|
26
|
+
}
|
|
8
27
|
const css = await globalThis.$fetch(`https://fonts.googleapis.com/css2?family=${name}:wght@${weight}`, {
|
|
9
28
|
headers: {
|
|
10
29
|
// Make sure it returns TTF.
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { H3Error, createError, defineEventHandler, getQuery, setHeader } from "h3";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { useOgImageBufferCache } from "../../../cache.mjs";
|
|
7
|
-
import { useOgImageRuntimeConfig } from "../../../utils.mjs";
|
|
8
|
-
import { useSiteConfig } from "#imports";
|
|
2
|
+
import { useOgImageBufferCache } from "../util/cache.mjs";
|
|
3
|
+
import { useOgImageRuntimeConfig } from "../../shared.mjs";
|
|
4
|
+
import { resolveContext } from "../og-image/context.mjs";
|
|
5
|
+
import { html } from "../og-image/templates/html.mjs";
|
|
9
6
|
export default defineEventHandler(async (e) => {
|
|
10
|
-
const ctx = await
|
|
7
|
+
const ctx = await resolveContext(e);
|
|
11
8
|
if (ctx instanceof H3Error)
|
|
12
9
|
return ctx;
|
|
13
10
|
const { isDebugJsonPayload, extension, options, renderer } = ctx;
|
|
@@ -19,21 +16,21 @@ export default defineEventHandler(async (e) => {
|
|
|
19
16
|
compatibilityHints.push("Converting PNGs to JPEGs requires Sharp which only runs on Node based systems.");
|
|
20
17
|
if (options.renderer === "chromium")
|
|
21
18
|
compatibilityHints.push("Using Chromium to generate images is only supported in Node based environments. It's recommended to only use this if you're prerendering");
|
|
22
|
-
if (options.component !== "PageScreenshot" && await applyInlineCss(ctx, await fetchIsland(ctx)))
|
|
23
|
-
compatibilityHints.push("Inlining CSS is only supported in Node based environments.");
|
|
24
19
|
setHeader(e, "Content-Type", "application/json");
|
|
25
20
|
return {
|
|
21
|
+
siteConfig: {
|
|
22
|
+
url: e.context.siteConfig.get().url
|
|
23
|
+
},
|
|
26
24
|
compatibilityHints,
|
|
27
25
|
cacheKey: ctx.key,
|
|
28
26
|
options: ctx.options,
|
|
29
|
-
siteConfig: useSiteConfig(e),
|
|
30
27
|
...options.renderer === "satori" ? await renderer.debug(ctx) : void 0
|
|
31
28
|
};
|
|
32
29
|
}
|
|
33
30
|
switch (extension) {
|
|
34
31
|
case "html":
|
|
35
32
|
setHeader(e, "Content-Type", `text/html`);
|
|
36
|
-
return
|
|
33
|
+
return html(ctx);
|
|
37
34
|
case "svg":
|
|
38
35
|
if (!debug && !import.meta.dev) {
|
|
39
36
|
return createError({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type H3Error } from 'h3';
|
|
2
|
-
import type { OgImageRenderEventContext } from '
|
|
2
|
+
import type { OgImageRenderEventContext } from '../../types';
|
|
3
3
|
export declare function useOgImageBufferCache(ctx: OgImageRenderEventContext, options: {
|
|
4
4
|
baseCacheKey: string | false;
|
|
5
5
|
cacheMaxAgeSeconds?: number;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function htmlDecodeQuotes(html) {
|
|
2
|
+
return html.replace(/"/g, '"').replace(/'/g, "'").replace(/'/g, "'");
|
|
3
|
+
}
|
|
4
|
+
export function decodeHtml(html) {
|
|
5
|
+
return html.replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&").replace(/¢/g, "\xA2").replace(/£/g, "\xA3").replace(/¥/g, "\xA5").replace(/€/g, "\u20AC").replace(/©/g, "\xA9").replace(/®/g, "\xAE").replace(/"/g, '"').replace(/'/g, "'").replace(/'/g, "'").replace(///g, "/").replace(/&#([0-9]+);/g, (full, int) => {
|
|
6
|
+
return String.fromCharCode(Number.parseInt(int));
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
export function decodeObjectHtmlEntities(obj) {
|
|
10
|
+
Object.entries(obj).forEach(([key, value]) => {
|
|
11
|
+
if (typeof value === "string")
|
|
12
|
+
obj[key] = decodeHtml(value);
|
|
13
|
+
});
|
|
14
|
+
return obj;
|
|
15
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { NitroRouteRules } from 'nitropack';
|
|
2
|
+
import type { H3Event } from 'h3';
|
|
3
|
+
import type { NuxtIslandResponse } from 'nuxt/dist/core/runtime/nitro/renderer';
|
|
4
|
+
export declare function fetchIsland(e: H3Event, component: string, props: Record<string, any>): Promise<NuxtIslandResponse>;
|
|
5
|
+
export declare function withoutQuery(path: string): string;
|
|
6
|
+
export declare function createNitroRouteRuleMatcher(): ((path: string) => NitroRouteRules);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createRouter as createRadixRouter, toRouteMatcher } from "radix3";
|
|
2
|
+
import { defu } from "defu";
|
|
3
|
+
import { withoutBase, withoutTrailingSlash } from "ufo";
|
|
4
|
+
import { hash } from "ohash";
|
|
5
|
+
import { useRuntimeConfig } from "#imports";
|
|
6
|
+
export function fetchIsland(e, component, props) {
|
|
7
|
+
const hashId = hash([component, props]);
|
|
8
|
+
return e.$fetch(`/__nuxt_island/${component}_${hashId}.json`, {
|
|
9
|
+
params: {
|
|
10
|
+
props: JSON.stringify(props)
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export function withoutQuery(path) {
|
|
15
|
+
return path.split("?")[0];
|
|
16
|
+
}
|
|
17
|
+
export function createNitroRouteRuleMatcher() {
|
|
18
|
+
const { nitro, app } = useRuntimeConfig();
|
|
19
|
+
const _routeRulesMatcher = toRouteMatcher(
|
|
20
|
+
createRadixRouter({
|
|
21
|
+
routes: Object.fromEntries(
|
|
22
|
+
Object.entries(nitro?.routeRules || {}).map(([path, rules]) => [withoutTrailingSlash(path), rules])
|
|
23
|
+
)
|
|
24
|
+
})
|
|
25
|
+
);
|
|
26
|
+
return (path) => {
|
|
27
|
+
return defu({}, ..._routeRulesMatcher.matchAll(
|
|
28
|
+
// radix3 does not support trailing slashes
|
|
29
|
+
withoutBase(withoutTrailingSlash(withoutQuery(path)), app.baseURL)
|
|
30
|
+
).reverse());
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { OgImageOptions } from '
|
|
2
|
-
declare const _default: import("vue").DefineComponent<OgImageOptions<"NuxtSeo">, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
1
|
+
import type { OgImageOptions } from '../../../types';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<OgImageOptions<"NuxtSeo">, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<OgImageOptions<"NuxtSeo">>, {
|
|
3
3
|
props?: any;
|
|
4
4
|
}, {}>;
|
|
5
5
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { OgImagePageScreenshotOptions } from '
|
|
2
|
-
declare const _default: import("vue").DefineComponent<OgImagePageScreenshotOptions, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
1
|
+
import type { OgImagePageScreenshotOptions } from '../../../types';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<OgImagePageScreenshotOptions, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<OgImagePageScreenshotOptions>, {
|
|
3
3
|
props?: any;
|
|
4
4
|
}, {}>;
|
|
5
5
|
export default _default;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { computed, defineComponent, h, resolveComponent } from 'vue'
|
|
7
|
-
import { useOgImageRuntimeConfig } from '
|
|
7
|
+
import { useOgImageRuntimeConfig } from '../../../../shared'
|
|
8
8
|
import { useSiteConfig } from '#imports'
|
|
9
9
|
|
|
10
10
|
// convert to typescript props
|
|
@@ -117,7 +117,7 @@ if (typeof props.icon === 'string' && !runtimeConfig.hasNuxtIcon && process.dev)
|
|
|
117
117
|
{{ description }}
|
|
118
118
|
</p>
|
|
119
119
|
</div>
|
|
120
|
-
<div v-if="icon" style="width: 30%;" class="flex justify-end">
|
|
120
|
+
<div v-if="Boolean(icon)" style="width: 30%;" class="flex justify-end">
|
|
121
121
|
<IconComponent :name="icon" size="250px" style="margin: 0 auto; opacity: 0.7;" />
|
|
122
122
|
</div>
|
|
123
123
|
</div>
|
|
@@ -25,10 +25,10 @@ const org = computed(() => props.title.split('/')[0])
|
|
|
25
25
|
const repo = computed(() => props.title.split('/')[1])
|
|
26
26
|
|
|
27
27
|
const stars = computed(() => {
|
|
28
|
-
return new Intl.NumberFormat('en-US', { notation: 'compact', compactDisplay: 'short' }).format(props.stars || 0)
|
|
28
|
+
return new Intl.NumberFormat('en-US', { notation: 'compact', compactDisplay: 'short' }).format(Number(props.stars || 0))
|
|
29
29
|
})
|
|
30
30
|
const downloads = computed(() => new Intl.NumberFormat('en-US', { notation: 'compact', compactDisplay: 'short' })
|
|
31
|
-
.format(props.downloads || 0),
|
|
31
|
+
.format(Number(props.downloads || 0)),
|
|
32
32
|
)
|
|
33
33
|
|
|
34
34
|
const description = computed(() => (props.description || '').slice(0, 200))
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { DefineOgImageInput } from '
|
|
1
|
+
import type { DefineOgImageInput } from '../../types';
|
|
2
2
|
export declare function defineOgImage(_options?: DefineOgImageInput): void;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { defu } from "defu";
|
|
2
2
|
import { appendHeader } from "h3";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { useNuxtApp, useRequestEvent, useRoute, useRuntimeConfig } from "#imports";
|
|
3
|
+
import { getOgImagePath, separateProps, useOgImageRuntimeConfig } from "../../shared.mjs";
|
|
4
|
+
import { createOgImageMeta, normaliseOptions } from "../utils.mjs";
|
|
5
|
+
import { createNitroRouteRuleMatcher } from "../../nitro/util/kit.mjs";
|
|
6
|
+
import { useNuxtApp, useRequestEvent, useRoute } from "#imports";
|
|
8
7
|
export function defineOgImage(_options = {}) {
|
|
9
8
|
if (!import.meta.server)
|
|
10
9
|
return;
|
|
@@ -12,12 +11,8 @@ export function defineOgImage(_options = {}) {
|
|
|
12
11
|
const ogImageInstances = nuxtApp.ssrContext._ogImageInstances || [];
|
|
13
12
|
const route = useRoute();
|
|
14
13
|
const basePath = route.path || "/";
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
);
|
|
18
|
-
const routeRules = defu({}, ..._routeRulesMatcher.matchAll(
|
|
19
|
-
withoutBase(basePath.split("?")[0], useRuntimeConfig().app.baseURL)
|
|
20
|
-
).reverse()).ogImage;
|
|
14
|
+
const routeRuleMatcher = createNitroRouteRuleMatcher();
|
|
15
|
+
const routeRules = routeRuleMatcher(basePath).ogImage;
|
|
21
16
|
if (!_options || nuxtApp.ssrContext?.event.context._nitro?.routeRules?.ogImage === false || typeof routeRules !== "undefined" && routeRules === false) {
|
|
22
17
|
ogImageInstances.forEach((e) => {
|
|
23
18
|
e.dispose();
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { ExtractComponentProps, OgImageOptions } from '
|
|
1
|
+
import type { ExtractComponentProps, OgImageOptions } from '../../types';
|
|
2
2
|
import type { OgImageComponents } from '#nuxt-og-image/components';
|
|
3
3
|
export declare function defineOgImageComponent<T extends keyof OgImageComponents>(component: T, props?: Partial<ExtractComponentProps<OgImageComponents[T]>>, options?: OgImageOptions): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { OgImagePageScreenshotOptions } from '
|
|
1
|
+
import type { OgImagePageScreenshotOptions } from '../../types';
|
|
2
2
|
export declare function defineOgImageScreenshot(options?: OgImagePageScreenshotOptions): any;
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { parseURL } from "ufo";
|
|
2
2
|
import { toValue } from "vue";
|
|
3
3
|
import { defu } from "defu";
|
|
4
|
-
import { isInternalRoute, separateProps } from "../../
|
|
4
|
+
import { isInternalRoute, separateProps } from "../../pure.mjs";
|
|
5
5
|
import { defineNuxtPlugin, useRequestEvent, withSiteUrl } from "#imports";
|
|
6
6
|
export default defineNuxtPlugin({
|
|
7
7
|
setup(nuxtApp) {
|
|
@@ -15,11 +15,18 @@ export default defineNuxtPlugin({
|
|
|
15
15
|
key: "nuxt-og-image:overrides-and-canonical-urls",
|
|
16
16
|
hooks: {
|
|
17
17
|
"tags:resolve": async (ctx2) => {
|
|
18
|
+
const hasPrimaryPayload = ctx2.tags.some((tag) => tag.tag === "script" && tag.props.id === "nuxt-og-image-options");
|
|
18
19
|
let overrides;
|
|
19
20
|
for (const tag of ctx2.tags) {
|
|
20
21
|
if (tag.tag === "script" && tag.props.id === "nuxt-og-image-overrides") {
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
if (hasPrimaryPayload) {
|
|
23
|
+
overrides = separateProps(JSON.parse(tag.innerHTML || "{}"));
|
|
24
|
+
delete ctx2.tags[ctx2.tags.indexOf(tag)];
|
|
25
|
+
} else {
|
|
26
|
+
tag.props.id = "nuxt-og-image-options";
|
|
27
|
+
tag.innerHTML = JSON.stringify(separateProps(JSON.parse(tag.innerHTML || "{}")));
|
|
28
|
+
tag._d = "script:id:nuxt-og-image-options";
|
|
29
|
+
}
|
|
23
30
|
break;
|
|
24
31
|
}
|
|
25
32
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defu } from "defu";
|
|
2
2
|
import { parseURL, withoutBase } from "ufo";
|
|
3
3
|
import { createRouter as createRadixRouter, toRouteMatcher } from "radix3";
|
|
4
|
-
import { getOgImagePath, isInternalRoute, useOgImageRuntimeConfig } from "../../
|
|
4
|
+
import { getOgImagePath, isInternalRoute, useOgImageRuntimeConfig } from "../../shared.mjs";
|
|
5
5
|
import { createOgImageMeta, normaliseOptions } from "../utils.mjs";
|
|
6
6
|
import { defineNuxtPlugin, useRequestEvent } from "#imports";
|
|
7
7
|
export default defineNuxtPlugin((nuxtApp) => {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { NuxtSSRContext } from 'nuxt/app';
|
|
1
2
|
import type { DefineOgImageInput, OgImageOptions, OgImagePrebuilt } from '../types';
|
|
2
|
-
export declare function createOgImageMeta(src: string | null, input: OgImageOptions | OgImagePrebuilt, resolvedOptions: OgImageOptions, ssrContext:
|
|
3
|
+
export declare function createOgImageMeta(src: string | null, input: OgImageOptions | OgImagePrebuilt, resolvedOptions: OgImageOptions, ssrContext: NuxtSSRContext): void;
|
|
3
4
|
export declare function normaliseOptions(_options: DefineOgImageInput): OgImageOptions | OgImagePrebuilt;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { defu } from "defu";
|
|
2
2
|
import { withQuery } from "ufo";
|
|
3
|
-
import { separateProps } from "../
|
|
3
|
+
import { getExtension, separateProps } from "../shared.mjs";
|
|
4
4
|
import { unref, useServerHead } from "#imports";
|
|
5
5
|
import { componentNames } from "#build/nuxt-og-image/components.mjs";
|
|
6
6
|
export function createOgImageMeta(src, input, resolvedOptions, ssrContext) {
|
|
7
7
|
const _input = separateProps(defu(input, ssrContext._ogImagePayload));
|
|
8
8
|
let url = src || input.url || resolvedOptions.url;
|
|
9
|
-
if (
|
|
9
|
+
if (!url)
|
|
10
|
+
return;
|
|
11
|
+
if (input._query && Object.keys(input._query).length && url)
|
|
10
12
|
url = withQuery(url, { _query: input._query });
|
|
11
|
-
let urlExtension = (url
|
|
13
|
+
let urlExtension = getExtension(url) || resolvedOptions.extension;
|
|
12
14
|
if (urlExtension === "jpg")
|
|
13
15
|
urlExtension = "jpeg";
|
|
14
16
|
const meta = [
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { InputFontConfig, OgImageOptions, ResolvedFontConfig } from './types';
|
|
2
|
+
export declare function toBase64Image(fileName: string, data: string | ArrayBuffer): string;
|
|
2
3
|
export declare function isInternalRoute(path: string): boolean;
|
|
3
4
|
export declare function separateProps(options: OgImageOptions | undefined, ignoreKeys?: string[]): {
|
|
4
5
|
props: Record<string, any>;
|
|
5
6
|
};
|
|
6
7
|
export declare function normaliseFontInput(fonts: InputFontConfig[]): ResolvedFontConfig[];
|
|
8
|
+
export declare function withoutQuery(path: string): string;
|
|
9
|
+
export declare function getExtension(path: string): string;
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import { defu } from "defu";
|
|
2
|
+
export function toBase64Image(fileName, data) {
|
|
3
|
+
const base64 = typeof data === "string" ? data : Buffer.from(data).toString("base64");
|
|
4
|
+
let type = "image/jpeg";
|
|
5
|
+
const ext = fileName.split(".").pop();
|
|
6
|
+
if (ext === "svg")
|
|
7
|
+
type = "image/svg+xml";
|
|
8
|
+
else if (ext === "png")
|
|
9
|
+
type = "image/png";
|
|
10
|
+
return `data:${type};base64,${base64}`;
|
|
11
|
+
}
|
|
2
12
|
export function isInternalRoute(path) {
|
|
3
13
|
const lastSegment = path.split("/").pop() || path;
|
|
4
14
|
return lastSegment.includes(".") || path.startsWith("/__") || path.startsWith("@");
|
|
@@ -49,7 +59,7 @@ export function normaliseFontInput(fonts) {
|
|
|
49
59
|
return {
|
|
50
60
|
cacheKey: f,
|
|
51
61
|
name,
|
|
52
|
-
weight: weight ||
|
|
62
|
+
weight: weight || 400,
|
|
53
63
|
style: "normal",
|
|
54
64
|
path: void 0
|
|
55
65
|
};
|
|
@@ -62,3 +72,11 @@ export function normaliseFontInput(fonts) {
|
|
|
62
72
|
};
|
|
63
73
|
});
|
|
64
74
|
}
|
|
75
|
+
export function withoutQuery(path) {
|
|
76
|
+
return path.split("?")[0];
|
|
77
|
+
}
|
|
78
|
+
export function getExtension(path) {
|
|
79
|
+
path = withoutQuery(path);
|
|
80
|
+
const lastSegment = path.split("/").pop() || path;
|
|
81
|
+
return lastSegment.split(".").pop() || lastSegment;
|
|
82
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { OgImageOptions, OgImageRuntimeConfig } from './types';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './pure';
|
|
3
3
|
export declare function getOgImagePath(pagePath: string, _options?: Partial<OgImageOptions>): string;
|
|
4
4
|
export declare function useOgImageRuntimeConfig(): OgImageRuntimeConfig;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { joinURL } from "ufo";
|
|
2
2
|
import { defu } from "defu";
|
|
3
3
|
import { useRuntimeConfig } from "#imports";
|
|
4
|
-
export * from "./
|
|
4
|
+
export * from "./pure.mjs";
|
|
5
5
|
export function getOgImagePath(pagePath, _options) {
|
|
6
6
|
const options = defu(_options, useOgImageRuntimeConfig().defaults);
|
|
7
7
|
return joinURL("/__og-image__/image", pagePath, `og.${options.extension}`);
|
package/dist/runtime/types.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export interface OgImageRuntimeConfig {
|
|
|
28
28
|
fonts: FontConfig[];
|
|
29
29
|
hasNuxtIcon: boolean;
|
|
30
30
|
colorPreference: 'light' | 'dark';
|
|
31
|
+
isNuxtContentDocumentDriven: boolean;
|
|
31
32
|
}
|
|
32
33
|
export interface OgImageComponent {
|
|
33
34
|
path?: string;
|
|
@@ -60,7 +61,7 @@ export interface ScreenshotOptions {
|
|
|
60
61
|
}
|
|
61
62
|
export type OgImagePrebuilt = {
|
|
62
63
|
url: string;
|
|
63
|
-
} & Pick<OgImageOptions, 'width' | 'height' | 'alt'>;
|
|
64
|
+
} & Pick<OgImageOptions, 'width' | 'height' | 'alt' | '_query'>;
|
|
64
65
|
export type DefineOgImageInput = OgImageOptions | OgImagePrebuilt | false;
|
|
65
66
|
export interface OgImageOptions<T extends keyof OgImageComponents = 'NuxtSeo'> {
|
|
66
67
|
/**
|
|
@@ -113,6 +114,7 @@ export interface OgImageOptions<T extends keyof OgImageComponents = 'NuxtSeo'> {
|
|
|
113
114
|
}
|
|
114
115
|
export interface FontConfig {
|
|
115
116
|
name: string;
|
|
117
|
+
style?: string;
|
|
116
118
|
weight?: string | number;
|
|
117
119
|
path?: string;
|
|
118
120
|
key?: string;
|
|
@@ -123,8 +125,8 @@ export interface ResolvedFontConfig extends FontConfig {
|
|
|
123
125
|
}
|
|
124
126
|
export type InputFontConfig = (`${string}:${number}` | string | FontConfig);
|
|
125
127
|
export interface RuntimeCompatibilitySchema {
|
|
126
|
-
chromium: '
|
|
127
|
-
['css-inline']: 'node' | false;
|
|
128
|
+
chromium: 'chrome-launcher' | 'on-demand' | 'playwright' | false;
|
|
129
|
+
['css-inline']: 'node' | 'wasm' | 'wasm-fs' | false;
|
|
128
130
|
resvg: 'node' | 'wasm' | 'wasm-fs' | false;
|
|
129
131
|
satori: 'node' | 'wasm' | 'wasm-fs' | false;
|
|
130
132
|
sharp: 'node' | false;
|
|
@@ -152,3 +154,7 @@ export interface SatoriTransformer {
|
|
|
152
154
|
filter: (node: VNode) => boolean;
|
|
153
155
|
transform: (node: VNode, e: OgImageRenderEventContext) => Promise<void>;
|
|
154
156
|
}
|
|
157
|
+
export interface SocialPreviewMetaData {
|
|
158
|
+
twitter?: Record<string, string>;
|
|
159
|
+
og?: Record<string, string>;
|
|
160
|
+
}
|