Skip to content

Commit edba725

Browse files
committed
fix: rollback to link based solution
1 parent 4949240 commit edba725

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

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

Lines changed: 5 additions & 7 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 { availableLocaleCodes } from '#site/next.locales.mjs';
5+
import { defaultLocale } from '#site/next.locales.mjs';
66

77
type DynamicStaticPaths = { locale: string; feed: string };
88
type StaticParams = { params: Promise<DynamicStaticPaths> };
@@ -26,12 +26,10 @@ 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-
availableLocaleCodes.flatMap(locale =>
30-
siteConfig.rssFeeds.map(feed => ({
31-
locale: locale,
32-
feed: feed.file,
33-
}))
34-
);
29+
siteConfig.rssFeeds.map(feed => ({
30+
locale: defaultLocale.code,
31+
feed: feed.file,
32+
}));
3533

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

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ 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
2425
aria-label={t('components.blog.blogHeader.rssLink')}
2526
>
2627
<RssIcon />

0 commit comments

Comments
 (0)