Skip to content

Commit eb03a32

Browse files
committed
fix: fix trailing slashes used in sitemap
1 parent 5dce798 commit eb03a32

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.changeset/stale-ladybugs-walk.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@blinkk/root': patch
3+
---
4+
5+
fix: fix trailing slashes used in sitemap

packages/root/src/render/router.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@ export function normalizeUrlPath(
198198
if (!urlPath.startsWith('/')) {
199199
urlPath = `/${urlPath}`;
200200
}
201+
// Add trailing slash if needed.
202+
if (options?.trailingSlash && !urlPath.endsWith('/')) {
203+
urlPath = `${urlPath}/`;
204+
}
201205
return urlPath;
202206
}
203207

0 commit comments

Comments
 (0)