Changeset 69815b2 in Klonkt for src/middleware


Ignore:
Timestamp:
06/24/2026 05:26:24 AM (3 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
6bd25d1
Parents:
5eef817
Message:

feat: auto-generated per-site OG image from palette + accent

New OgImageService renders a themed 1200x630 social card (palette gradient +
accent + site title/tagline + klonkt wordmark) via @resvg/resvg-js, cached on
disk. Served at GET /og/:slug.png and used as the default og:image/twitter:image
when a site has no custom share image — so every site gets a branded preview.
Bundles a static Fraunces TTF for rendering; graceful no-op if resvg can't load.

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/middleware/render.js

    r5eef817 r69815b2  
    137137    cspNonce: () => '',
    138138    currentPath: req.path,
     139    // Absolute origin (for building absolute URLs like the generated og:image).
     140    ogOrigin: (process.env.PUBLIC_BASE_URL || `${req.protocol}://${req.get('host') || ''}`).replace(/\/+$/, ''),
    139141    ...data,
    140142  };
Note: See TracChangeset for help on using the changeset viewer.