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
This commit is contained in:
@@ -31,7 +31,9 @@ export async function generateStaticParams() {
|
|||||||
type ContentType = 'product' | 'portfolio';
|
type ContentType = 'product' | 'portfolio';
|
||||||
|
|
||||||
function findContentBySlug(slug: string[]): { type: ContentType; data: typeof productCategories[0] | typeof portfolioProjects[0] } | null {
|
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
|
// Check products first
|
||||||
const product = productCategories.find((p) => p.href === fullPath);
|
const product = productCategories.find((p) => p.href === fullPath);
|
||||||
|
|||||||
Reference in New Issue
Block a user