docs: put the landing-page link in the book's sticky menu bar - #3
Merged
Merged
Conversation
The header partial rendered above mdBook's menu bar, which is `position: sticky; top: 0`. The partial is not, so on any page long enough to read, the way back scrolled out of view immediately and the docs were still a dead end going up. Move the link into the menu bar's right-buttons group, beside the repository icon, where it stays on screen and reads as a way out of the book. That means overriding index.hbs rather than only adding a partial; a smaller override that does not work is not smaller. Co-Authored-By: Claude Opus 5 (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.
Getting from https://nix-caisson.github.io/caisson/docs/ back to the landing page is still hard, despite the link added earlier.
Why the earlier fix did not work
The link lived in
theme/header.hbs, which mdBook renders above its menu bar. That menu bar isposition: sticky; top: 0and stays pinned while you scroll; the header partial has no positioning, so it scrolls away as soon as you start reading. On any page long enough to be worth reading, the way back was off screen. The markup was on every page and the stylesheet loaded, so nothing looked broken from the outside; it just was not there when a reader wanted it.What changed
The link moves into the menu bar's
right-buttonsgroup, beside the repository icon, which is where a reader looks for a way out of a book. It stays visible while reading. On screens narrower than 500px the word is hidden and the mark carries it, matching how mdBook treats its own buttons.This requires overriding
theme/index.hbsrather than only supplying a partial, which the earlier change deliberately avoided to keep the override small. That tradeoff was wrong: an override that does not work is not smaller.theme/header.hbsis deleted.Verification
mdbook buildsucceeds and the link renders on all 18 reader-facing pages, inside the sticky menu bar element rather than above it, withhrefresolving to../at the book root and../../one level down. The styling uses mdBook's own--iconsand--menu-bar-heightvariables, so it follows the theme in both light and navy.