import { ImageResponse } from "next/og"; import type { NextRequest } from "next/server"; import { loadContent } from "@/site/load"; /** * The share image for a page without its own (ROADMAP-v3 §11: "Pages without their own image get a * share image generated from the church's logo and colours"): 1200 × 630, the church's colour, its * name and the page's title. `?t=` is the title (only shown, never trusted for anything else). */ export async function GET(request: NextRequest) { const c = await loadContent(); const title = (request.nextUrl.searchParams.get("t") ?? "").slice(0, 90); const name = c.church?.name ?? "Our church"; const rgb = (triple: string) => `rgb(${triple.split(" ").join(",")})`; const logo = c.church?.branding.logoUrl; return new ImageResponse( (