chore: disable static params generation for blog post page

This commit is contained in:
Mauricio Siu
2025-03-02 21:32:47 -06:00
parent 630b42a80e
commit f8d9bf1905

View File

@@ -67,21 +67,20 @@ export async function generateMetadata(
}; };
} }
export async function generateStaticParams() { // export async function generateStaticParams() {
const posts = await getPosts(); // const posts = await getPosts();
const locales = ["en", "fr", "zh-Hans"]; // const locales = ["en", "fr", "zh-Hans"];
return posts.flatMap((post) => // return posts.flatMap((post) =>
locales.map((locale) => ({ // locales.map((locale) => ({
locale, // locale,
slug: post.slug, // slug: post.slug,
})), // })),
); // );
} // }
export default async function BlogPostPage({ params }: Props) { export default async function BlogPostPage({ params }: Props) {
const { slug } = await params; const { slug } = await params;
// setRequestLocale(locale);
const t = await getTranslations("blog"); const t = await getTranslations("blog");
const post = await getPost(slug); const post = await getPost(slug);
const allPosts = await getPosts(); const allPosts = await getPosts();