fix(website): revert generateStaticParams params to non-Promise
generateStaticParams receives plain params (not Promise). Only page/layout default exports get Promise params in Next.js 15+. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,13 +10,12 @@ import { JsonLd } from "@/components/seo/json-ld";
|
||||
import { getPostBySlug, getAllPosts } from "@/lib/blog";
|
||||
import { ArrowLeft, ArrowRight, Clock, Calendar } from "lucide-react";
|
||||
|
||||
export async function generateStaticParams({
|
||||
export function generateStaticParams({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ locale: string }>;
|
||||
params: { locale: string };
|
||||
}) {
|
||||
const { locale } = await params;
|
||||
const posts = getAllPosts(locale as "fa" | "en");
|
||||
const posts = getAllPosts(params.locale as "fa" | "en");
|
||||
return posts.map((p) => ({ slug: p.slug }));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user