Skip to content
Early bird + Black Friday · 73% off

Get ZeroDirs for $179 $49

Claim $49 deal

OG images

Every listing and category page gets its own 1200×630 Open Graph image, rendered during pnpm build. seo.ogImages: 'generated' is the default; 'static' points every page at public/og-default.png instead.

  1. Leave seo.ogImages on 'generated', or set it.

    site.config.ts
    seo: {
    ogImages: 'generated',
    ogScope: { listings: true, categories: true, pseo: false },
    },

    pnpm check:config answers site.config.ts OK — <name> (<url>); ….

  2. Regenerate the fallback — the shipped one carries the demo’s name.

    Terminal
    pnpm og:default
    public/og-default.png: 1200×630, N bytes — "<site.name>" (<site.tagline>)

    pnpm og:default --check exits 1 with public/og-default.png is out of date — run: pnpm og:default.

  3. Build and read the og: lines; check fallbacks=0.

    Terminal
    pnpm build
    og: N images to produce (L listings, C categories, 0 pseo, 1 default)
    og: rendered N images in S s (cache hits H)
    [zerodirs:og] engine=native, rendered=R, fallbacks=0, logos … / satori … / resvg …; cache=node_modules/.cache/zerodirs/og/ (…)
  4. Open https://<your domain>/og/<listingBase>/<slug>.png — on the demo, /og/tools/chatgpt.png.

    A listing’s OG image in the theme colours

Where You should see
The count the build output og: N images to produce (…), then fallbacks=0
The image https://<your domain>/og/<listingBase>/<slug>.png a 1200×630 PNG with that listing’s name and logo
The tag view-source:https://<your domain>/<listingBase>/<slug>/ <meta property="og:image" content="https://<your domain>/og/<listingBase>/<slug>.png">, with og:image:width 1200
The fallback pnpm og:default --check public/og-default.png is up to date (N bytes, "<site.name>")
  • Images are written during the build; a listing change needs a rebuild.
  • /og/<listingBase>/<slug>.png for a listing, /og/<categoryBase>/<slug>.png for a category, /og/<slug>.png for a generated page, /og/default.png for everything else.
  • OG_RENDERER=wasm in .env is a build-time variable, never read from wrangler.jsonc.
  • Cached in node_modules/.cache/zerodirs/og/: a logo edited in place keeps its hash, so delete that directory to force a render. Workers Builds keeps no cache, so a git-push deploy re-renders everything.
Config state The visitor sees /admin/ reports Fix
seo.ogImages: 'static' public/og-default.png on every page nothing expected; run pnpm og:default
a render fails the fallback bytes; [zerodirs:og] <path>: render failed (…); serving public/og-default.png instead, fallbacks=N nothing fix the cause and rebuild
the native addon does not load the same images, slower: [zerodirs:og] @resvg/resvg-js could not be loaded (…); falling back to @resvg/resvg-wasm (set OG_RENDERER=wasm to silence) nothing set OG_RENDERER=wasm in .env
a font file is missing render failed (og: font <path> is missing …), fallbacks=N; pnpm og:default refuses to write nothing restore src/assets/fonts/og/
public/og-default.png is missing under 'static' every og:image is a 404; under 'generated' the first failed render stops the build with og: fallback image <file> is missing (…) nothing pnpm og:default
seo.ogScope.pseo: true one PNG per generated page, against the plan file limit nothing turn it off when the budget warns

seo.ogImages, the three seo.ogScope switches, theme.preset and theme.tokens.primary — seo, theme. One catch: a hex theme.tokens.primary reaches the image, an oklch() value does not.

  • Directorysrc/
    • Directorypages/og/ the prerendered endpoint and the og: count line
      • …
    • Directoryfeatures/og/
      • template.ts the satori layout and OG_TEMPLATE_VERSION
      • render.ts satori, resvg, the wasm and render-failed fallbacks
      • specs.ts which pages get an image
      • cache.ts the content-hash cache
      • fonts.ts the Inter faces
    • Directoryassets/fonts/og/ Inter Regular and Bold, TTF
      • …
  • scripts/og-default.ts pnpm og:default and --check
  • public/og-default.png the fallback and the static image