From d2b133ed3d1bdb7b2af566c28ff2a9b2ffd1a69d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asger=20Geel=20Weirs=C3=B8e?= Date: Tue, 6 Oct 2026 17:35:13 +0200 Subject: [PATCH] List /tarballz/ in the sitemap with its trailing slash The slash stripping meant for Astro's routes also turned the tarball index into /tarballz, which the web host answers with a 301 to /tarballz/. A sitemap should only list the final URL. Claude-Session: https://claude.ai/code/session_01GGe7kUhooMFuzY6GaDb2w9 --- astro.config.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/astro.config.mjs b/astro.config.mjs index dc92dca..84e88fc 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -161,7 +161,9 @@ export default defineConfig({ // Samme kanoniske form som og de interne links: // uden afsluttende skråstreg. Slås lastmod op FØR strippet, fordi // lastmodByRoute er nøglet på Astros egne ruter (som har skråstregen). - if (pathname !== '/') item.url = item.url.replace(/\/$/, ''); + // Undtagen /tarballz/: den er ikke en Astro-side, og webhosten serverer + // den kun med skråstreg (uden skråstreg giver den en 301). + if (pathname !== '/' && pathname !== '/tarballz/') item.url = item.url.replace(/\/$/, ''); return item; }, }),