From 0e4016e09ce3f91846b4c32a3ef7de24e68072fe Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Sat, 30 Aug 2025 06:15:01 +0530 Subject: [PATCH] fix(web): temporarily disable docs og image --- apps/web/src/app/docs-og/[...slug]/_route.tsx | 27 +++++++++++++++++++ apps/web/src/app/docs-og/[...slug]/route.tsx | 25 ----------------- apps/web/src/app/docs/[[...slug]]/page.tsx | 16 +++++------ 3 files changed, 35 insertions(+), 33 deletions(-) create mode 100644 apps/web/src/app/docs-og/[...slug]/_route.tsx delete mode 100644 apps/web/src/app/docs-og/[...slug]/route.tsx diff --git a/apps/web/src/app/docs-og/[...slug]/_route.tsx b/apps/web/src/app/docs-og/[...slug]/_route.tsx new file mode 100644 index 0000000..10553ba --- /dev/null +++ b/apps/web/src/app/docs-og/[...slug]/_route.tsx @@ -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"], +// })); +// } diff --git a/apps/web/src/app/docs-og/[...slug]/route.tsx b/apps/web/src/app/docs-og/[...slug]/route.tsx deleted file mode 100644 index 30b22e4..0000000 --- a/apps/web/src/app/docs-og/[...slug]/route.tsx +++ /dev/null @@ -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"], - })); -} diff --git a/apps/web/src/app/docs/[[...slug]]/page.tsx b/apps/web/src/app/docs/[[...slug]]/page.tsx index 6251ccc..64fd334 100644 --- a/apps/web/src/app/docs/[[...slug]]/page.tsx +++ b/apps/web/src/app/docs/[[...slug]]/page.tsx @@ -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, + // }, }; }