Initialisieren
This commit is contained in:
17
app/opengraph-image.tsx
Normal file
17
app/opengraph-image.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import { ImageResponse } from "next/og";
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { join } from "node:path";
|
||||
import { OgImageContent, ogImageSize } from "@/lib/og-image";
|
||||
|
||||
export const alt = "Entscheidomat – Lass den Zufall entscheiden";
|
||||
export const size = ogImageSize;
|
||||
export const contentType = "image/png";
|
||||
|
||||
export const runtime = "nodejs";
|
||||
|
||||
export default async function Image() {
|
||||
const image = await readFile(join(process.cwd(), "public/images/og-decision-tools.jpg"));
|
||||
const visualSrc = `data:image/jpeg;base64,${image.toString("base64")}`;
|
||||
|
||||
return new ImageResponse(<OgImageContent visualSrc={visualSrc} />, size);
|
||||
}
|
||||
Reference in New Issue
Block a user