diff --git a/src/components/Header.astro b/src/components/Header.astro index 3321543..6f4a53e 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -1,17 +1,16 @@ --- -import type { Props } from '@astrojs/starlight/props'; import SiteTitle from "@astrojs/starlight/components/SiteTitle.astro"; import Search from "@astrojs/starlight/components/Search.astro"; import ThemeSelect from "@astrojs/starlight/components/ThemeSelect.astro"; import SocialIcons from "@astrojs/starlight/components/SocialIcons.astro"; ---
- +
- - + +
- +
diff --git a/src/components/PageSidebar.astro b/src/components/PageSidebar.astro index 16d604c..4c5210e 100644 --- a/src/components/PageSidebar.astro +++ b/src/components/PageSidebar.astro @@ -1,17 +1,17 @@ --- -import type { Props } from '@astrojs/starlight/props'; import Default from '@astrojs/starlight/components/PageSidebar.astro'; const removeOverview = [ 'iana', ] -const noOverview = removeOverview.includes(Astro.props.slug); -const toc = noOverview && Astro.props.toc !== undefined - ? { - ...Astro.props.toc, - items: Astro.props.toc?.items.slice(1), - } - : Astro.props.toc; +const { id, toc } = Astro.locals.starlightRoute; +const noOverview = removeOverview.includes(id); +if (noOverview && toc) { + Astro.locals.starlightRoute.toc = { + ...toc, + items: toc.items.slice(1), + }; +} --- - +