feat: add collapsible mobile ToC for in-page navigation#203
Merged
Conversation
Add an "On this page" details element that lists h2 headings, visible only at <=960px where the sidebar ToC is hidden. Placed after the h1 in every chapter page. Closes #110 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace standalone MobileToc component with an "On this page" section inside the hamburger nav panel. JS clones h2 links from the existing sidebar-toc at runtime. Tapping a section link closes the panel and scrolls to the heading. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The inline script ran before the sidebar-toc element was in the DOM, so querySelector returned null and no links were added. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove ToC injection from hamburger menu. Add a dedicated sticky "On this page" bar below the header, visible only at <=960px. Expands to show h2 section links, closes on link tap or outside click. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sticky positioning requires the element to be inside the scrolling container. Moved from between Header and site-main to inside main. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Teal FAB in bottom-right corner on mobile. Tap to open an overlay listing h2 section links. Closes on link tap or outside click. Zero layout impact — no sticky, no header changes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MobileToc.astrocomponent — collapsible "On this page" listing h2 headingsDocLayout.astro, visible only at <=960pxTest plan