mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
fix(web): temporarily disable docs og image
This commit is contained in:
27
apps/web/src/app/docs-og/[...slug]/_route.tsx
Normal file
27
apps/web/src/app/docs-og/[...slug]/_route.tsx
Normal 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"],
|
||||||
|
// }));
|
||||||
|
// }
|
||||||
@@ -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"],
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
@@ -50,16 +50,16 @@ export async function generateMetadata({
|
|||||||
const page = source.getPage(slug);
|
const page = source.getPage(slug);
|
||||||
if (!page) notFound();
|
if (!page) notFound();
|
||||||
|
|
||||||
const image = `/docs-og/${slug.join("/")}/image.png`;
|
// const image = `/docs-og/${slug.join("/")}/image.png`;
|
||||||
return {
|
return {
|
||||||
title: page.data.title,
|
title: page.data.title,
|
||||||
description: page.data.description,
|
description: page.data.description,
|
||||||
openGraph: {
|
// openGraph: {
|
||||||
images: image,
|
// images: image,
|
||||||
},
|
// },
|
||||||
twitter: {
|
// twitter: {
|
||||||
card: "summary_large_image",
|
// card: "summary_large_image",
|
||||||
images: image,
|
// images: image,
|
||||||
},
|
// },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user