diff --git a/.gitignore b/.gitignore index e3d97f6..24df554 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,9 @@ dist/ # JetBrains IDE .idea/ +# Claude Code +.claude/ + # Unit test reports TEST*.xml diff --git a/astro-site/src/components/Header.astro b/astro-site/src/components/Header.astro index c28adf1..b7bdf98 100644 --- a/astro-site/src/components/Header.astro +++ b/astro-site/src/components/Header.astro @@ -90,4 +90,5 @@ const base = import.meta.env.BASE_URL; navToggle.setAttribute("aria-expanded", "false"); siteTabs.classList.remove("open"); }); + diff --git a/astro-site/src/components/MobileToc.astro b/astro-site/src/components/MobileToc.astro new file mode 100644 index 0000000..3fd4566 --- /dev/null +++ b/astro-site/src/components/MobileToc.astro @@ -0,0 +1,60 @@ +--- +interface Heading { + depth: number; + slug: string; + text: string; +} + +const { headings = [] } = Astro.props as { headings: Heading[] }; +const h2s = headings.filter((h) => h.depth === 2); +--- + +{h2s.length > 0 && ( +
+ +
+
On this page
+ +
+
+)} + + diff --git a/astro-site/src/layouts/DocLayout.astro b/astro-site/src/layouts/DocLayout.astro index e9a11b6..6eccdfd 100644 --- a/astro-site/src/layouts/DocLayout.astro +++ b/astro-site/src/layouts/DocLayout.astro @@ -4,6 +4,7 @@ import Header from "../components/Header.astro"; import TableOfContents from "../components/TableOfContents.astro"; import TutorialLinks from "../components/TutorialLinks.astro"; import Footer from "../components/Footer.astro"; +import MobileToc from "../components/MobileToc.astro"; import site from "../data/site.json"; interface Props { @@ -71,6 +72,7 @@ const ogImage = new URL("/tutorial-git/images/og-banner.png", Astro.site);
+