Skip to content

Commit

Permalink
Fix: remove odd /1/ check on RSS canonicals (#6970)
Browse files Browse the repository at this point in the history
* fix: remove odd `/1/` check on RSS canonicals

* chore: changeset
  • Loading branch information
bholmesdev authored May 2, 2023
1 parent b6797fc commit b5482ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/flat-peas-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@astrojs/rss": patch
---

Fix: remove accidental stripping of trailing `/1/` on canonical URLs
1 change: 0 additions & 1 deletion packages/astro-rss/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export function createCanonicalURL(
base?: string
): URL {
let pathname = url.replace(/\/index.html$/, ''); // index.html is not canonical
pathname = pathname.replace(/\/1\/?$/, ''); // neither is a trailing /1/ (impl. detail of collections)
if (trailingSlash === false) {
// remove the trailing slash
pathname = pathname.replace(/(\/+)?$/, '');
Expand Down

0 comments on commit b5482ce

Please sign in to comment.