fix(web): temporarily disable docs og image

This commit is contained in:
Aman Varshney
2025-08-30 06:15:01 +05:30
parent f37412f076
commit 0e4016e09c
3 changed files with 35 additions and 33 deletions

View File

@@ -0,0 +1,27 @@
// temporary disable og image because it exceeded worker 3 mb limit
// import { generateOGImage } from "fumadocs-ui/og";
// import { notFound } from "next/navigation";
// import { source } from "@/lib/source";
// export async function GET(
// _req: Request,
// { params }: { params: Promise<{ slug: string[] }> },
// ) {
// const { slug } = await params;
// const page = source.getPage(slug.slice(0, -1));
// if (!page) notFound();
// return generateOGImage({
// title: page.data.title,
// description: page.data.description,
// site: "Better-T-Stack",
// });
// }
// export function generateStaticParams() {
// return source.generateParams().map((page) => ({
// ...page,
// slug: [...page.slug, "image.png"],
// }));
// }

View File

@@ -1,25 +0,0 @@
import { generateOGImage } from "fumadocs-ui/og";
import { notFound } from "next/navigation";
import { source } from "@/lib/source";
export async function GET(
_req: Request,
{ params }: { params: Promise<{ slug: string[] }> },
) {
const { slug } = await params;
const page = source.getPage(slug.slice(0, -1));
if (!page) notFound();
return generateOGImage({
title: page.data.title,
description: page.data.description,
site: "Better-T-Stack",
});
}
export function generateStaticParams() {
return source.generateParams().map((page) => ({
...page,
slug: [...page.slug, "image.png"],
}));
}

View File

@@ -50,16 +50,16 @@ export async function generateMetadata({
const page = source.getPage(slug);
if (!page) notFound();
const image = `/docs-og/${slug.join("/")}/image.png`;
// const image = `/docs-og/${slug.join("/")}/image.png`;
return {
title: page.data.title,
description: page.data.description,
openGraph: {
images: image,
},
twitter: {
card: "summary_large_image",
images: image,
},
// openGraph: {
// images: image,
// },
// twitter: {
// card: "summary_large_image",
// images: image,
// },
};
}