withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
46.65k stars 2.48k forks source link

@astrojs/rss item-level `customData` omitted in 1.1.0 #5582

Closed mattstein closed 1 year ago

mattstein commented 1 year ago

What version of astro are you using?

1.6.14

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

npm

What operating system are you using?

macOS 13.0.1

Describe the Bug

When I update the @astrojs/rss package to 1.1.0, the new RSSFeedItem’s content property works as expected but anything passed to customData is omitted from the rendered output.

It looks like the cause is this commit, which seems like it’s mistakenly looking at rssOptions.customData when it should be result.customData.

In the StackBlitz example, you can see a <dc:creator> tag for “Third Post” when the RSS package is pinned to 1.0.3:

<item>
<title>Third post</title>
<link>https://example.com/blog/third-post/</link>
<guid>https://example.com/blog/third-post/</guid>
<dc:creator>Buster Bluth</dc:creator>
</item>

Updating to 1.1.0, that tag vanishes. (Which has no relationship to the content parameter.) Anything passed to customData will fail to appear in the rendered feed:

<item>
<title>Third post</title>
<link>https://example.com/blog/third-post/</link>
<guid>https://example.com/blog/third-post/</guid>
</item>

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-7ijnap-7fzwp3?file=src/pages/rss.xml.js

Participation

matthewp commented 1 year ago

Can you submit a PR to fix this?

mattstein commented 1 year ago

Let’s find out! I’ll take a crack at it in the next day or two.