Dashboardbyk.github.ioSeoHead.astro canonical tag as defense-…

SeoHead.astro canonical tag as defense-in-depth against redirect bugs

Category: pattern
Confidence: 0.85
ID: 019f84af-f1ca-7f8f-b217-f1f81b2ba460
Project ID: 27022d30-10a9-49e4-8a75-dae8ea101609
Cross-project: No
Recalled in other projects: 0
Source session: 1H6zthdbm2YTrMQ2H
Created: 2026-07-21 12:39:11
Updated: 2026-07-21 12:39:11

Content

src/components/general/SeoHead.astro builds permalink from Astro.url.pathname (not Astro.site) for og:url/twitter:url — correct at build time since Astro defaults to build.format: "directory", generating trailing-slash paths. Added <link rel="canonical" href={permalink} /> (line ~16) as defense-in-depth against upstream infra bugs (GitHub Pages/Cloudflare redirect issues, see related gotcha) that can serve broken previews for no-slash URLs even though the repo's own HTML is always correct.

Move to: