mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
72cc7db1bd
fixes #80275 .. to generate https image urls in meta data when using the --experimental-https flag --------- Co-authored-by: Zack Tanner <1939140+ztanner@users.noreply.github.com> Co-authored-by: JJ Kasper <jj@jjsweb.site>
35 lines
675 B
TypeScript
35 lines
675 B
TypeScript
import { ImageResponse } from 'next/og'
|
|
|
|
export const alt = 'Test OpenGraph Image'
|
|
export const size = {
|
|
width: 800,
|
|
height: 600,
|
|
}
|
|
|
|
export const contentType = 'image/png'
|
|
|
|
export default async function Image() {
|
|
return new ImageResponse(
|
|
(
|
|
<div
|
|
style={{
|
|
fontSize: 24,
|
|
background: 'linear-gradient(90deg, #000 0%, #111 100%)',
|
|
color: 'white',
|
|
width: '100%',
|
|
height: '100%',
|
|
display: 'flex',
|
|
textAlign: 'center',
|
|
alignItems: 'center',
|
|
justifyContent: 'center',
|
|
}}
|
|
>
|
|
OpenGraph Test Image
|
|
</div>
|
|
),
|
|
{
|
|
...size,
|
|
}
|
|
)
|
|
}
|