import { readFile } from 'node:fs/promises'; import { join } from 'node:path'; import { ImageResponse } from 'next/og'; import { BARS } from '@/components/Logo'; /** * The site had no og:image at all, so every link pasted into a class WhatsApp * group or a Slack channel rendered as a bare grey text card โ on the highest * intent channel this product has. * * The card is the mark at poster scale: the cohort as a wide distribution with * one school lit up. It states the proposition rather than decorating it. */ export const alt = 'SchoolCompare โ compare every school in England against the national picture'; export const size = { width: 1200, height: 630 }; export const contentType = 'image/png'; const PAPER = '#f2f1ed'; const INK = '#16202a'; const MUTED = '#5c6570'; const BRAND = '#584a9b'; // A plausible national distribution, drawn once at poster scale. The lit bar // is the same position the mark uses. const SPREAD = [8, 12, 17, 24, 33, 44, 57, 70, 82, 92, 98, 100, 96, 88, 77, 65, 53, 41, 31, 22, 15, 10, 7, 5]; // Right of the peak: score runs left to right, so the lit school reads as // above the national average. At index 9 it sat on the low side, which quietly // said the opposite. const LIT = 14; async function font(file: string) { return readFile(join(process.cwd(), 'assets', file)); } export default async function OpengraphImage() { const [regular, bold] = await Promise.all([ font('SchibstedGrotesk-Regular.ttf'), font('SchibstedGrotesk-Bold.ttf'), ]); return new ImageResponse( (