Skip to content

Commit 2c72755

Browse files
committed
fix: applied fix on link on generation
1 parent 63883cd commit 2c72755

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

apps/site/app/[locale]/feed/[feed]/route.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { NextResponse } from 'next/server';
22

33
import provideWebsiteFeeds from '#site/next-data/providers/websiteFeeds';
44
import { siteConfig } from '#site/next.json.mjs';
5-
import { defaultLocale } from '#site/next.locales.mjs';
5+
import { availableLocaleCodes } from '#site/next.locales.mjs';
66

77
type DynamicStaticPaths = { locale: string; feed: string };
88
type StaticParams = { params: Promise<DynamicStaticPaths> };
@@ -26,10 +26,12 @@ export const GET = async (_: Request, props: StaticParams) => {
2626
// `[locale]/feeds/[feed]` and returns an array of all available static paths
2727
// This is used for ISR static validation and generation
2828
export const generateStaticParams = async () =>
29-
siteConfig.rssFeeds.map(feed => ({
30-
locale: defaultLocale.code,
31-
feed: feed.file,
32-
}));
29+
availableLocaleCodes.flatMap(locale =>
30+
siteConfig.rssFeeds.map(feed => ({
31+
locale: locale,
32+
feed: feed.file,
33+
}))
34+
);
3335

3436
// Enforces that only the paths from `generateStaticParams` are allowed, giving 404 on the contrary
3537
// @see https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#dynamicparams

apps/site/components/Blog/BlogHeader/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ const BlogHeader: FC<BlogHeaderProps> = ({ category }) => {
2121
{t('layouts.blog.title')}
2222
<Link
2323
href={`/feed/${currentFile}`}
24-
{...{ locale: 'en' }} // RSS feeds only exist in English
2524
aria-label={t('components.blog.blogHeader.rssLink')}
2625
>
2726
<RssIcon />

0 commit comments

Comments
 (0)