Skip to content

Commit

Permalink
chore: fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ovflowd committed Nov 9, 2024
1 parent 0f85559 commit 3e1aff9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions apps/site/next.dynamic.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -226,17 +226,17 @@ const getDynamicRouter = async () => {
path
);

// Add the default blog feed as the list of feed for the page
pageMetadata.alternates.types['application/rss+xml'] = getUrlForPathname(
locale,
'feed/blog.xml'
// Retrieves a matching blog feed for the category of the blog post
// If no matching blog feed is found, we simply fallback to the default blog feed
const matchingBlogFeed = siteConfig.rssFeeds.find(
feed => feed.category === data.category
);

// Simply assume that a blog feed exists for a given category, otherwise,
// the page will simply give a 404 as it does not exist, which is fine
// Adds the RSS Feed URL to the page metadata, if a matching feed is found
// otherwise, we fallback to the default blog feed
pageMetadata.alternates.types['application/rss+xml'] = getUrlForPathname(
locale,
`feed/${data.category ?? DEFAULT_CATEGORY_OG_TYPE}.xml`
`feed/${matchingBlogFeed?.file ?? 'blog.xml'}`
);

// Iterate all languages to generate alternate URLs for each language
Expand Down
2 changes: 1 addition & 1 deletion apps/site/site.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{
"title": "Node.js Blog: Releases",
"file": "releases.xml",
"category": "releases"
"category": "release"
},
{
"title": "Node.js Blog: Vulnerability Reports",
Expand Down

0 comments on commit 3e1aff9

Please sign in to comment.