From 13f0f1f3dc0463ddd2527d75faca859ee6f6af2d Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 28 Apr 2026 18:22:42 +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 ab5193c..17baed0 100644 --- a/src/pages/tag/[tag]/index.astro +++ b/src/pages/tag/[tag]/index.astro @@ -28,7 +28,7 @@ const page = { }, }; -const canonical = `${site.url}/tag/${tag}/`; +const canonical = `${site.url}/tag/${encodeURIComponent(tag)}/`; ---