-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@astrojs/rss uses trailing slash on home page when it shouldn't #10994
Comments
Hello! 👋 There was a discussion about this on another issue here: #10723 (comment) In summary: The urls are treated as the same, there is no difference between |
@BryceRussell Thanks! I somehow missed that issue |
@mingjunlu No worries! @patrickreiner I am going to go ahead and close this since this is expected behavior. If you have any other issues feel free to open another issue 😀 |
Hi @BryceRussell, thank you, I agree with your label of "nice to have" where it's not breaking anything, but it would be nice to have the visual consistency. @astrojs/sitemap for example used to work like this as well (where the home page always had a trailing backslash) but that behavior was recently corrected as you can see here https://astro-rss-trailing-slash.patrickreiner.com/sitemap-0.xml |
You're right! Sorry, I did not realize the sitemap had a similar change recently and did not consider that this could be changed even if it is only visual. For reference, there is a workflow for triaging issues that I try to follow, but I am still learning 😅 I will re-open this issue |
It looks like this issue happens because the links are transformed from a string, to a astro/packages/astro-rss/src/util.ts Line 20 in a78fa26
astro/packages/astro-rss/src/index.ts Lines 219 to 224 in a78fa26
Example:
|
@BryceRussell That's exactly the reason. I'm willing to work on it if you don't mind 😉 |
For awareness, the recent change on the sitemap was not just cosmetic like it is here; in that case, it affects SEO by having the canonical URL of a page mismatched between the page and the sitemap. |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
In my astro.config.mjs I set:
export default defineConfig({
...
trailingSlash: 'never',
})
and in my vercel.json I set:
{
"cleanUrls": true,
...
"trailingSlash": false
}
and in my rss.xml.js I set:
export async function GET(context) {
return rss({
trailingSlash: false,
})
}
and yet, the RSS feed still puts a slash on the home page, viewable here:
http://astro-rss-trailing-slash.patrickreiner.com/rss.xml
What's the expected result?
RSS home page should not have a trailing slash.
Should be:
https://astro-rss-trailing-slash.patrickreiner.comNot:
https://astro-rss-trailing-slash.patrickreiner.com/Link to Minimal Reproducible Example
https://github.com/patrickreiner/astro-rss-trailing-slash
Participation
The text was updated successfully, but these errors were encountered: