mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
41 lines
784 B
TypeScript
41 lines
784 B
TypeScript
import fs from 'fs'
|
|
import path from 'path'
|
|
import { ImageResponse } from 'next/og'
|
|
|
|
export const contentType = 'image/png'
|
|
|
|
export default async function og() {
|
|
const font = await fs.promises.readFile(
|
|
path.join(process.cwd(), 'assets/typewr__.ttf')
|
|
)
|
|
return new ImageResponse(
|
|
(
|
|
<div
|
|
style={{
|
|
width: '100%',
|
|
height: '100%',
|
|
display: 'flex',
|
|
alignItems: 'center',
|
|
justifyContent: 'center',
|
|
fontSize: 88,
|
|
background: '#fff',
|
|
color: '#000',
|
|
}}
|
|
>
|
|
Typewriter og
|
|
</div>
|
|
),
|
|
{
|
|
fonts: [
|
|
{
|
|
name: 'Typewriter',
|
|
data: font,
|
|
style: 'normal',
|
|
},
|
|
],
|
|
}
|
|
)
|
|
}
|
|
|
|
export const runtime = 'nodejs'
|