Fix opengraph image prerender so production builds succeed.
Drop file fetches and embedded fonts that fail during static OG generation; use default ImageResponse typography instead. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -9,20 +9,6 @@ export const contentType = "image/png";
|
|||||||
export default async function Image() {
|
export default async function Image() {
|
||||||
const [logoPrefix, logoSuffix] = splitLogoText(brand.logoText);
|
const [logoPrefix, logoSuffix] = splitLogoText(brand.logoText);
|
||||||
|
|
||||||
const geistMono = await fetch(
|
|
||||||
new URL(
|
|
||||||
"../../public/fonts/geist/mono/GeistMono-VariableFont_wght.ttf",
|
|
||||||
import.meta.url,
|
|
||||||
),
|
|
||||||
).then((res) => res.arrayBuffer());
|
|
||||||
|
|
||||||
const playfair = await fetch(
|
|
||||||
new URL(
|
|
||||||
"../../node_modules/@fontsource-variable/playfair-display/files/playfair-display-latin-wght-normal.woff2",
|
|
||||||
import.meta.url,
|
|
||||||
),
|
|
||||||
).then((res) => res.arrayBuffer());
|
|
||||||
|
|
||||||
return new ImageResponse(
|
return new ImageResponse(
|
||||||
(
|
(
|
||||||
<div
|
<div
|
||||||
@@ -70,7 +56,6 @@ export default async function Image() {
|
|||||||
style={{
|
style={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
fontFamily: "Geist Mono",
|
|
||||||
fontSize: 72,
|
fontSize: 72,
|
||||||
fontWeight: 700,
|
fontWeight: 700,
|
||||||
letterSpacing: "-0.02em",
|
letterSpacing: "-0.02em",
|
||||||
@@ -84,7 +69,6 @@ export default async function Image() {
|
|||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
marginTop: 32,
|
marginTop: 32,
|
||||||
fontFamily: "Playfair Display",
|
|
||||||
fontSize: 40,
|
fontSize: 40,
|
||||||
fontWeight: 600,
|
fontWeight: 600,
|
||||||
color: "#09090b",
|
color: "#09090b",
|
||||||
@@ -97,7 +81,6 @@ export default async function Image() {
|
|||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
marginTop: 16,
|
marginTop: 16,
|
||||||
fontFamily: "Geist Mono",
|
|
||||||
fontSize: 22,
|
fontSize: 22,
|
||||||
fontWeight: 400,
|
fontWeight: 400,
|
||||||
color: "#71717a",
|
color: "#71717a",
|
||||||
@@ -113,20 +96,6 @@ export default async function Image() {
|
|||||||
),
|
),
|
||||||
{
|
{
|
||||||
...size,
|
...size,
|
||||||
fonts: [
|
|
||||||
{
|
|
||||||
name: "Geist Mono",
|
|
||||||
data: geistMono,
|
|
||||||
style: "normal",
|
|
||||||
weight: 700,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Playfair Display",
|
|
||||||
data: playfair,
|
|
||||||
style: "normal",
|
|
||||||
weight: 600,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user