Config reference: fix anchor scrolling and comment pairing - #8
Closed
predictiple wants to merge 6 commits into
Closed
predictiple wants to merge 6 commits into
predictiple wants to merge 6 commits into
Conversation
…idex#1310) CI just started failing on Vale — not because of the content, but because `version: latest` recently pulled in Vale 3.22.0. 3.22.0 introduced a tokenizer regression that merges words across markdown links / inline HTML: - `[Carbon Black](...)allows` → "Blackallows" - `<span>Published</span>on` → "Publishedon" None of the flagged files changed; the tool did. Confirmed locally with the exact CI binaries: 3.21.0 passes, 3.22.0 fails. This pins Vale to 3.21.0 so we can bump deliberately once it's fixed upstream.
Items render key/breadcrumb/value as code and their documentation comment as prose alongside. Each item and its comment share one '.ref-block' div so the filter hides a block as a unit. Container items keep the comment inside the collapsible <summary>, right under the key, instead of below the expanded nested content where it would fall off the page. Comments are emitted flush-left so Hugo's markdown parser does not treat the closing </div> as an indented code block.
Shared #fragment links to config reference items scrolled the target to the very top of the viewport, hiding it under the fixed navbar. Give .ref-item cards a scroll-margin-top of the navbar height plus breathing room so fragment links land the item just below the navbar.
The Hextra 'On this page' column can now be folded away entirely by a reader-driven toggle, letting the article expand to the extra width. Two floating chevron buttons park at the article column's top-right corner, just below the navbar: a right-facing collapse chevron while the column is expanded and a left-facing expand chevron while it is collapsed. The choice persists in localStorage, applied before first paint by an inline script, so the column is already the right width on first sight. The buttons live outside the nav and use fixed positioning so they stay reachable mid-scroll and survive the column being display:none. Their offset accounts for the announcement banner via --hextra-banner-height; the theme's static default (2rem) is smaller than the real banner and it only re-measures in deferred JS, so the default is pre-set to the measured 2.5rem here to avoid a first-paint jump. Text at xl gets extra right padding so it clears the chevrons while scrolling. Styled in custom.css as plain CSS: Hextra's prebuilt main.css is static, so new hx: utilities are not generated. Hides below the xl breakpoint (no TOC there) and in print. Implementation mirrors the existing sidebar-scroll persistence pattern.
Owner
Author
|
Creating this against upstream instead |
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.
Two fixes for the config reference page:
#fragmentlinks to ref items were scrolling the target under the fixed navbar. Addedscroll-margin-topto.ref-itemcards so the item lands just below the navbar..ref-blockas its item, so the filter hides both together. Container items keep the comment under the key inside the<summary>, and comments are emitted flush-left so Hugo doesn't mangle the markup.Also on this branch: a collapsible "On this page" column. Two chevrons at the article's top-right corner (below the navbar) let readers fold the TOC away to give the article more room; the choice persists in
localStorage, applied pre-paint. Desktop-only (xl+), hidden in print.