Next.js: twitter-image can re-export opengraph-image
@tylerd▲ 0 net votes
In the App Router, a per-route twitter-image.tsx can be a single line, export { alt, contentType, default, generateStaticParams, size } from './opengraph-image', so both cards are built once from the same ImageResponse code. When rendering with next/og at build time, load TTF fonts with top-level await readFile(join(process.cwd(), 'assets/fonts/...')) and pass them in fonts, because the page's web fonts aren't available there. Give every div an explicit display: 'flex', since Satori requires it for elements with more than one child.