From 63883cdc08bf1e90afd27bedafd1b82213921b03 Mon Sep 17 00:00:00 2001 From: kylemocode Date: Wed, 13 Aug 2025 17:17:41 +0800 Subject: [PATCH 1/4] fix: rss button navigate to 404 page if not with en locale --- apps/site/components/Blog/BlogHeader/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/site/components/Blog/BlogHeader/index.tsx b/apps/site/components/Blog/BlogHeader/index.tsx index d345b8bf1e5b7..ba78975f827be 100644 --- a/apps/site/components/Blog/BlogHeader/index.tsx +++ b/apps/site/components/Blog/BlogHeader/index.tsx @@ -21,6 +21,7 @@ const BlogHeader: FC = ({ category }) => { {t('layouts.blog.title')} From 2c727554e4ba2facf8fd815fdeba9500c7297116 Mon Sep 17 00:00:00 2001 From: kylemocode Date: Wed, 13 Aug 2025 19:50:27 +0800 Subject: [PATCH 2/4] fix: applied fix on link on generation --- apps/site/app/[locale]/feed/[feed]/route.ts | 12 +++++++----- apps/site/components/Blog/BlogHeader/index.tsx | 1 - 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/site/app/[locale]/feed/[feed]/route.ts b/apps/site/app/[locale]/feed/[feed]/route.ts index a5abc2981a17b..661221435e6dd 100644 --- a/apps/site/app/[locale]/feed/[feed]/route.ts +++ b/apps/site/app/[locale]/feed/[feed]/route.ts @@ -2,7 +2,7 @@ import { NextResponse } from 'next/server'; import provideWebsiteFeeds from '#site/next-data/providers/websiteFeeds'; import { siteConfig } from '#site/next.json.mjs'; -import { defaultLocale } from '#site/next.locales.mjs'; +import { availableLocaleCodes } from '#site/next.locales.mjs'; type DynamicStaticPaths = { locale: string; feed: string }; type StaticParams = { params: Promise }; @@ -26,10 +26,12 @@ export const GET = async (_: Request, props: StaticParams) => { // `[locale]/feeds/[feed]` and returns an array of all available static paths // This is used for ISR static validation and generation export const generateStaticParams = async () => - siteConfig.rssFeeds.map(feed => ({ - locale: defaultLocale.code, - feed: feed.file, - })); + availableLocaleCodes.flatMap(locale => + siteConfig.rssFeeds.map(feed => ({ + locale: locale, + feed: feed.file, + })) + ); // Enforces that only the paths from `generateStaticParams` are allowed, giving 404 on the contrary // @see https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#dynamicparams diff --git a/apps/site/components/Blog/BlogHeader/index.tsx b/apps/site/components/Blog/BlogHeader/index.tsx index ba78975f827be..d345b8bf1e5b7 100644 --- a/apps/site/components/Blog/BlogHeader/index.tsx +++ b/apps/site/components/Blog/BlogHeader/index.tsx @@ -21,7 +21,6 @@ const BlogHeader: FC = ({ category }) => { {t('layouts.blog.title')} From 9ae03dd41851187c5a2ddfb008b0c2ff3e64b0b5 Mon Sep 17 00:00:00 2001 From: kylemocode Date: Fri, 15 Aug 2025 21:13:51 +0800 Subject: [PATCH 3/4] fix: rollback to link based solution --- apps/site/app/[locale]/feed/[feed]/route.ts | 12 +++++------- apps/site/components/Blog/BlogHeader/index.tsx | 1 + 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/apps/site/app/[locale]/feed/[feed]/route.ts b/apps/site/app/[locale]/feed/[feed]/route.ts index 661221435e6dd..a5abc2981a17b 100644 --- a/apps/site/app/[locale]/feed/[feed]/route.ts +++ b/apps/site/app/[locale]/feed/[feed]/route.ts @@ -2,7 +2,7 @@ import { NextResponse } from 'next/server'; import provideWebsiteFeeds from '#site/next-data/providers/websiteFeeds'; import { siteConfig } from '#site/next.json.mjs'; -import { availableLocaleCodes } from '#site/next.locales.mjs'; +import { defaultLocale } from '#site/next.locales.mjs'; type DynamicStaticPaths = { locale: string; feed: string }; type StaticParams = { params: Promise }; @@ -26,12 +26,10 @@ export const GET = async (_: Request, props: StaticParams) => { // `[locale]/feeds/[feed]` and returns an array of all available static paths // This is used for ISR static validation and generation export const generateStaticParams = async () => - availableLocaleCodes.flatMap(locale => - siteConfig.rssFeeds.map(feed => ({ - locale: locale, - feed: feed.file, - })) - ); + siteConfig.rssFeeds.map(feed => ({ + locale: defaultLocale.code, + feed: feed.file, + })); // Enforces that only the paths from `generateStaticParams` are allowed, giving 404 on the contrary // @see https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#dynamicparams diff --git a/apps/site/components/Blog/BlogHeader/index.tsx b/apps/site/components/Blog/BlogHeader/index.tsx index d345b8bf1e5b7..ba78975f827be 100644 --- a/apps/site/components/Blog/BlogHeader/index.tsx +++ b/apps/site/components/Blog/BlogHeader/index.tsx @@ -21,6 +21,7 @@ const BlogHeader: FC = ({ category }) => { {t('layouts.blog.title')} From 9d78eaee7b8529f39d54a6e435ee771f018d2777 Mon Sep 17 00:00:00 2001 From: kylemocode Date: Wed, 20 Aug 2025 09:08:31 +0800 Subject: [PATCH 4/4] chore: simplify prop usage based on type definition change on Link component --- apps/site/components/Blog/BlogHeader/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/site/components/Blog/BlogHeader/index.tsx b/apps/site/components/Blog/BlogHeader/index.tsx index ba78975f827be..5aa65fcc28786 100644 --- a/apps/site/components/Blog/BlogHeader/index.tsx +++ b/apps/site/components/Blog/BlogHeader/index.tsx @@ -21,7 +21,7 @@ const BlogHeader: FC = ({ category }) => { {t('layouts.blog.title')}