From bee756594bece88f5a43432f66da88a7c0bab6be Mon Sep 17 00:00:00 2001 From: Benjamin Date: Tue, 3 Mar 2026 08:57:48 +0100 Subject: [PATCH] update sitemap links (#186) --- src/components/starlight/Head.astro | 12 ++++++++++++ src/layouts/Head.astro | 1 + 2 files changed, 13 insertions(+) diff --git a/src/components/starlight/Head.astro b/src/components/starlight/Head.astro index b66d627..9cc4afb 100644 --- a/src/components/starlight/Head.astro +++ b/src/components/starlight/Head.astro @@ -3,6 +3,18 @@ import Default from "@astrojs/starlight/components/Head.astro"; import { getImagePath } from "@components/images"; +// Update the sitemap to point to our custom sitemap +Astro.locals.starlightRoute.head.forEach(({ tag, attrs }) => { + if ( + tag === "link" && + attrs && + attrs.rel === "sitemap" && + attrs.href === "/sitemap-index.xml" + ) { + attrs.href = "/ayc0-sitemap-index.xml"; + } +}); + let imagePath: string | undefined = await getImagePath( Astro.locals.starlightRoute.entry.data.image, ); diff --git a/src/layouts/Head.astro b/src/layouts/Head.astro index 5bc7333..f132ec5 100644 --- a/src/layouts/Head.astro +++ b/src/layouts/Head.astro @@ -22,6 +22,7 @@ let imagePath: string | undefined = await getImagePath(image); {title} {description ? : null} + -- 2.51.2