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() {
const posts = await getPosts();
const locales = ["en", "fr", "zh-Hans"];
// export async function generateStaticParams() {
// const posts = await getPosts();
// const locales = ["en", "fr", "zh-Hans"];
return posts.flatMap((post) =>
locales.map((locale) => ({
locale,
slug: post.slug,
})),
);
}
// return posts.flatMap((post) =>
// locales.map((locale) => ({
// locale,
// slug: post.slug,
// })),
// );
// }
export default async function BlogPostPage({ params }: Props) {
const { slug } = await params;
// setRequestLocale(locale);
const t = await getTranslations("blog");
const post = await getPost(slug);
const allPosts = await getPosts();