refactor: migrate TrumpSignal to TypeScript monorepo and Pages Router
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* Dynamic favicon. Renders the brand mark (α) on the dark brand background.
|
||||
*
|
||||
* Next.js auto-discovers this file and wires it into the page <head> as
|
||||
* <link rel="icon"> for every route. No static asset needed in /public.
|
||||
*
|
||||
* For larger PWA install icons (192/512), see app/apple-icon.tsx and the
|
||||
* manifest.ts entries that reference them.
|
||||
*/
|
||||
import { ImageResponse } from 'next/og'
|
||||
|
||||
const size = { width: 64, height: 64 }
|
||||
const contentType = 'image/png'
|
||||
|
||||
function Icon() {
|
||||
return new ImageResponse(
|
||||
<div
|
||||
style={{
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
background: '#0a0907',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
fontSize: 44,
|
||||
fontWeight: 700,
|
||||
color: '#f5a524',
|
||||
fontFamily: 'system-ui, sans-serif',
|
||||
lineHeight: 1,
|
||||
}}
|
||||
>
|
||||
α
|
||||
</div>,
|
||||
{ ...size },
|
||||
)
|
||||
}
|
||||
|
||||
export default async function handler(
|
||||
_req: import('next').NextApiRequest,
|
||||
res: import('next').NextApiResponse,
|
||||
) {
|
||||
const image = Icon()
|
||||
res.setHeader('Content-Type', 'image/png')
|
||||
res.setHeader('Cache-Control', 'public, max-age=86400')
|
||||
res.send(Buffer.from(await image.arrayBuffer()))
|
||||
}
|
||||
Reference in New Issue
Block a user