Skip to content

Commit 00f3b9e

Browse files
committed
fix(website): canonical url was wrong with query string
1 parent 12fc84d commit 00f3b9e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/layout.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ const query = new URLSearchParams(
5151
),
5252
)
5353
54+
const currentUrlNoQS = new URL(currentUrl.toString().replace(currentUrl.search, ""))
5455
const canonicalUrl = new URL(
55-
currentUrl + (query.size > 0 ? "?" + query.toString() : ""),
56+
currentUrlNoQS.toString() + (query.size > 0 ? "?" + query.toString() : ""),
5657
Astro.site,
5758
)
5859
---

0 commit comments

Comments
 (0)