From 3a326b7f84554e037a38bff9f5983847cc3bd143 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 28 Apr 2026 18:22:47 +0800 Subject: [PATCH] fix(seo): URL-encode tag in canonical link Tag pages emitted with literal spaces. Wrap with encodeURIComponent so the canonical matches the encoded URL in the sitemap. --- src/pages/tag/[tag]/index.astro | 2 +- src/pages/tag/[tag]/page/[page]/index.astro | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/tag/[tag]/index.astro b/src/pages/tag/[tag]/index.astro index 2068385..3173910 100644 --- a/src/pages/tag/[tag]/index.astro +++ b/src/pages/tag/[tag]/index.astro @@ -26,7 +26,7 @@ const page = { }, }; -const canonical = `${site.url}/tag/${tag}/`; +const canonical = `${site.url}/tag/${encodeURIComponent(tag)}/`; ---