From 77b33e837d06d58fe1e48692b6a76c2fc5dc029e Mon Sep 17 00:00:00 2001 From: Obsidian Sync Date: Wed, 25 Feb 2026 19:33:42 +0530 Subject: [PATCH] Fix twitter:url to use pretty URL, add trailing slash --- src/components/Head.astro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Head.astro b/src/components/Head.astro index e4e7741..3320654 100644 --- a/src/components/Head.astro +++ b/src/components/Head.astro @@ -26,7 +26,7 @@ const canonicalURL = new URL(Astro.url.pathname, Astro.site); const pathParts = Astro.url.pathname.split('/').filter(Boolean); const blogPostMatch = pathParts[0] === 'blog' ? pathParts[1] : pathParts[0]; const isBlogPost = blogPostMatch?.match(/^\d{4}-\d{2}-\d{2}-/); -const finalCanonicalPath = isBlogPost ? `/${blogPostMatch}` : Astro.url.pathname; +const finalCanonicalPath = isBlogPost ? `/${blogPostMatch}/` : Astro.url.pathname; const finalCanonicalURL = new URL(finalCanonicalPath, Astro.site); const { title, description, image = "/astro-micro.jpg" } = Astro.props; @@ -59,7 +59,7 @@ const { title, description, image = "/astro-micro.jpg" } = Astro.props; - +