From 1ecd405ecafdde76026d13f1be4207cd5b4fe534 Mon Sep 17 00:00:00 2001 From: Kunthawat Greethong Date: Thu, 26 Feb 2026 07:37:12 +0700 Subject: [PATCH] Fix Thai URL decoding in catch-all route - Added decodeURIComponent to handle URL-encoded Thai characters - All product and portfolio pages now work correctly - 64 static pages generated successfully --- src/app/[...slug]/page.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/[...slug]/page.tsx b/src/app/[...slug]/page.tsx index e281414e0..e6ce882fa 100644 --- a/src/app/[...slug]/page.tsx +++ b/src/app/[...slug]/page.tsx @@ -31,7 +31,9 @@ export async function generateStaticParams() { type ContentType = 'product' | 'portfolio'; function findContentBySlug(slug: string[]): { type: ContentType; data: typeof productCategories[0] | typeof portfolioProjects[0] } | null { - const fullPath = '/' + slug.join('/') + '/'; + // Decode URL-encoded slug parts + const decodedSlug = slug.map(part => decodeURIComponent(part)); + const fullPath = '/' + decodedSlug.join('/') + '/'; // Check products first const product = productCategories.find((p) => p.href === fullPath);