-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0b8d52e
commit 4d210fb
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* eslint-disable @next/next/no-img-element */ | ||
import { ImageResponse } from "next/og"; | ||
|
||
// Route segment config | ||
export const runtime = "edge"; | ||
|
||
// Image metadata | ||
export const alt = "About Acme"; | ||
export const size = { | ||
width: 1200, | ||
height: 630, | ||
}; | ||
|
||
export const contentType = "image/png"; | ||
|
||
// Image generation | ||
export default async function Image() { | ||
// Font | ||
const manropeSemiBold = fetch( | ||
new URL("./project/[pid]/_opengraph/Manrope-SemiBold.ttf", import.meta.url), | ||
).then((res) => res.arrayBuffer()); | ||
|
||
return new ImageResponse( | ||
( | ||
<div | ||
style={{ | ||
fontSize: 102, | ||
background: "#000", | ||
width: "100%", | ||
height: "100%", | ||
display: "flex", | ||
alignItems: "center", | ||
justifyContent: "center", | ||
color: "white", | ||
gap: "2rem", | ||
}} | ||
> | ||
<div | ||
style={{ | ||
display: "flex", | ||
flexDirection: "column", | ||
gap: "0.5rem", | ||
maxWidth: 800, | ||
}} | ||
> | ||
<span style={{ fontWeight: "bold" }}>📒NEARCatalog</span> | ||
</div> | ||
</div> | ||
), | ||
{ | ||
...size, | ||
fonts: [ | ||
{ | ||
name: "Manrope", | ||
data: await manropeSemiBold, | ||
style: "normal", | ||
weight: 400, | ||
}, | ||
], | ||
}, | ||
); | ||
} |