From a292b15b5b150cba3c5b787164db580131cf1db0 Mon Sep 17 00:00:00 2001 From: Enrico Piovesan Date: Sat, 11 Jul 2026 09:57:41 -0600 Subject: [PATCH] fix: make /sitemap.xml list all pages directly, not an index-of-one @astrojs/sitemap unconditionally emits a sitemapindex wrapper (sitemap-index.xml -> sitemap-0.xml) regardless of site size -- there is no config option to skip it. That's valid per the sitemap protocol and every real crawler follows the reference automatically, but it meant /sitemap.xml (which I'd pointed at a static copy of the index in the previous fix) only showed one entry, not the 89 real page URLs, which is what a human clicking the link reasonably expects for a site this size. Replaced the static placeholder with a postbuild step that copies the real, already-serialize()-transformed sitemap-0.xml over sitemap.xml after every build, so it's always the complete, correct, and never- stale list of all pages -- generated fresh each build from the actual page set, not hand-maintained. Updated robots.txt to point at the simpler /sitemap.xml directly. Co-Authored-By: Claude Sonnet 5 --- package.json | 1 + public/robots.txt | 2 +- public/sitemap.xml | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 public/sitemap.xml diff --git a/package.json b/package.json index 83519e0..8be1dda 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "scripts": { "dev": "astro dev", "build": "astro build", + "postbuild": "cp dist/sitemap-0.xml dist/sitemap.xml", "preview": "astro preview", "astro": "astro" }, diff --git a/public/robots.txt b/public/robots.txt index 79542e4..d6c801c 100644 --- a/public/robots.txt +++ b/public/robots.txt @@ -1,4 +1,4 @@ User-agent: * Allow: / -Sitemap: https://traverse-framework.com/sitemap-index.xml +Sitemap: https://traverse-framework.com/sitemap.xml diff --git a/public/sitemap.xml b/public/sitemap.xml deleted file mode 100644 index 6ef05bd..0000000 --- a/public/sitemap.xml +++ /dev/null @@ -1 +0,0 @@ -https://traverse-framework.com/sitemap-0.xml