Skip to content

Commit 1b1b9ea

Browse files
authored
blog: Fix homepage link in rss feed
When following the Node.js Blog at https://nodejs.org/en/blog in a feed reader like NetNewsWire, or when sharing a blog roll via OPML ([example](https://gist.github.com/Krinkle/e0d13f84b91e829afffa7b27822482be)), the homepage link gets broken. Instead of navigating the browser to the website, one gets a blank page and an unexpected RSS feed download in the background. The `<link>` tag in RSS 2.0 is for the HTML website. The "self" link for the RSS file itself is already generated by [jpmonette/feed](https://github.com/jpmonette/feed) package. While at it, also limit the impact of the broken `description` element. This is accepted as parameter here, but not actually passed in `/apps/site/site.json`. The field is optional in RSS, so it's fine to omit. But as-is, it was outputting the string `"undefined"` as the blog's description. Signed-off-by: Timo Tijhof <krinkle@fastmail.com>
1 parent f7e9126 commit 1b1b9ea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/site/next-data/generators/websiteFeeds.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ const generateWebsiteFeeds = ({ posts }) => {
3232
id: file,
3333
title: title,
3434
language: 'en',
35-
link: `${canonicalUrl}/feed/${file}`,
36-
description: description,
35+
link: `${canonicalUrl}/`,
36+
description: description || '',
3737
});
3838

3939
const blogFeedEntries = posts

0 commit comments

Comments
 (0)