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:
soroush.asadi
2026-05-28 22:56:50 +03:30
parent 98a7efc719
commit 060f724f7c
@@ -10,13 +10,12 @@ import { JsonLd } from "@/components/seo/json-ld";
import { getPostBySlug, getAllPosts } from "@/lib/blog"; import { getPostBySlug, getAllPosts } from "@/lib/blog";
import { ArrowLeft, ArrowRight, Clock, Calendar } from "lucide-react"; import { ArrowLeft, ArrowRight, Clock, Calendar } from "lucide-react";
export async function generateStaticParams({ export function generateStaticParams({
params, params,
}: { }: {
params: Promise<{ locale: string }>; params: { locale: string };
}) { }) {
const { locale } = await params; const posts = getAllPosts(params.locale as "fa" | "en");
const posts = getAllPosts(locale as "fa" | "en");
return posts.map((p) => ({ slug: p.slug })); return posts.map((p) => ({ slug: p.slug }));
} }