---
/**
* Sidebar with sticker group labels. Top-level groups get a colored sticker,
* nested groups a small heading, and collapsed groups (the generated type
* reference) a disclosure. Link attrs from src/sidebar.ts:
* `data-dot` adds a colored dot, `data-code` uses the code font.
*/
import type { StarlightRouteData } from "@astrojs/starlight/route-data";
import SidebarPersister from "@astrojs/starlight/components/SidebarPersister.astro";
import SidebarList from "../components/SidebarList.astro";
type Entry = StarlightRouteData["sidebar"][number];
const { sidebar } = Astro.locals.starlightRoute;
const hasCurrent = (entry: Entry): boolean =>
entry.type === "link" ? entry.isCurrent : entry.entries.some(hasCurrent);
const stickerColors = ["var(--jp-red)", "var(--jp-sky)", "var(--jp-mint)", "#c9a8ff"];
const stickerTilt = [-1.5, 1.2, -1, 1.5];
---
{/* Starlight's persister restores the sidebar's scroll from the last page,
so it stays put when you move between pages. */}