Skip to content

Commit

Permalink
vercel deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
eckartal authored and eckartal committed Dec 31, 2024
1 parent b839452 commit 41c1753
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions app/(post)/og/[id]/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,16 @@ import { join } from "path";
export const revalidate = 60;

export async function generateStaticParams() {
return (await getPosts()).map(post => ({ id: post.id }));
return (await getPosts()).map((post) => ({ id: post.id }));
}

// fonts
// Fonts
const fontsDir = join(process.cwd(), "fonts");

const inter300 = readFileSync(
join(fontsDir, "inter-latin-300-normal.woff")
);

const inter500 = readFileSync(
join(fontsDir, "inter-latin-500-normal.woff")
);

const inter600 = readFileSync(
join(fontsDir, "inter-latin-600-normal.woff")
);

const robotoMono400 = readFileSync(
join(fontsDir, "roboto-mono-latin-400-normal.woff")
);
const inter300 = readFileSync(join(fontsDir, "inter-latin-300-normal.woff"));
const inter500 = readFileSync(join(fontsDir, "inter-latin-500-normal.woff"));
const inter600 = readFileSync(join(fontsDir, "inter-latin-600-normal.woff"));
const robotoMono400 = readFileSync(join(fontsDir, "roboto-mono-latin-400-normal.woff"));

export async function GET(req: Request) {
const { searchParams } = new URL(req.url);
Expand All @@ -38,7 +27,8 @@ export async function GET(req: Request) {
}

const posts = await getPosts();
const post = posts.find(p => p.id === id);
const post = posts.find((p) => p.id === id);

if (!post) {
return new Response("Not Found", { status: 404 });
}
Expand Down Expand Up @@ -79,4 +69,17 @@ export async function GET(req: Request) {
{
width: 1200,
height: 630,
fonts:
fonts: [
{ name: "Inter 300", data: inter300 },
{ name: "Inter 500", data: inter500 },
{ name: "Inter 600", data: inter600 },
{ name: "Roboto Mono 400", data: robotoMono400 },
],
}
);
}

// Helper function for styles
function font(fontFamily: string) {
return { fontFamily };
}

0 comments on commit 41c1753

Please sign in to comment.