RSS integration does not respect trailingSlash
configuration option
#6427
Labels
- P2: nice to have
Not breaking anything but nice to have (priority)
What version of
astro
are you using?2.0.17
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
npm
What operating system are you using?
Linux
Describe the Bug
While playing with the RSS integration (
@astrojs/rss
, version2.1.1
), I realized that it always forces trailing slashes even when thetrailingSlash
option is set tonever
.This behavior only applies when the link isn't already a valid URL. However, considering common usages, including examples provided in the documentation, the current implementation forces trailing slashes.
astro/packages/astro-rss/src/index.ts
Lines 184 to 186 in 9d236c9
Looking at the documentation, the
trailingSlash
option should not alter trailing slashes in this case. However, this option is already used in the sitemap integration (@astrojs/sitemap
) to alter the behavior of trailing slashes for production builds and is not limited to the dev server as suggested. This has been changed by #4553.Therefore, for consistency, it would make sense to also apply the same logic to the URLs generated for RSS feeds.
You can observe this in the following minimal reproducible example where adding
trailingSlash: 'never'
in the configuration affects the sitemap generation but not the RSS feed.Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-l6d4mc
Participation
The text was updated successfully, but these errors were encountered: