List /tarballz/ in the sitemap with its trailing slash
Build & Deploy / deploy (push) Successful in 3m9s

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
This commit is contained in:
Asger Geel Weirsøe
2026-10-06 17:35:13 +02:00
parent 9103dca0f4
commit d2b133ed3d
+3 -1
View File
@@ -161,7 +161,9 @@ export default defineConfig({
// Samme kanoniske form som <link rel="canonical"> 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;
},
}),