Repository navigation
Context-aware docs search with section badges, sub-results, and direct URLs - #184
Conversation
…t URLs
Implements the search feedback from the team thread plus remaining
production nice-to-haves:
- Every docs page is tagged with its product section (Router / Gateway /
Console) as a pagefind filter and metadata; result titles carry the
section badge ("Usage Reporting · Router")
- The search modal is now composed explicitly and defaults the section
filter to the section being browsed — searching from a Router page
returns Router results; a section dropdown in the modal header widens
back to all docs. Blog content was already excluded (only docs pages
carry data-pagefind-body)
- show-sub-results lists matching headings beneath each page for context
- A url metadata override makes result links point at the canonical
slash-less URL, removing the 301 hop on every result click (also the
main cause of the white blink when navigating from the dark-mode
modal)
- sitemap.xml gains <lastmod> per page, derived from the git history of
the content files in a single pass (439 of 559 URLs)
Verified headlessly against a served build: composed modal renders in
both themes with zero console errors, Router-page searches return only
Router results with the dropdown as the escape hatch, result hrefs have
no trailing slash, and the prefixed build passes the base-path verifier.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
- The section dropdown menu was cut off: the pf-modal dialog clips overflow for its rounded corners, and with a short result list the menu extended past the dialog edge. Let the menu escape (important, since pagefind's stylesheet loads after the bundled CSS). - "Duplicate" results were each page's own h1 emitted as its first sub-result. Search indexing is now scoped to the description and content only — the h1 stays outside (the explicit title metadata already names the page), and breadcrumbs / prev-next links no longer leak into excerpts either. - Bonus surfaced by the review screenshot: "[!toc]" markers on deep headings rendered literally on pages and in search results — a remark plugin now strips them (the TOC already only lists depths 2-4). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Both fixed in 51c429f (@dotansimha):
Bonus your screenshot surfaced: |
- pagefind's entire dark theme (result-loading skeletons included) is scoped to [data-pf-theme="dark"], which the site never set — so in dark mode the placeholders flashed white while results loaded. ThemeInit now keeps data-pf-theme in sync with the site theme, brand skeleton colors are defined for both themes, and the dark --pf-* brand overrides moved to html.dark so pagefind's later-loading dark defaults can't override them at equal specificity. - The composed pagefind-modal-header element has no layout styling of its own, so the section dropdown trigger sat touching the search input. It's a flex column with a gap now. Verified in both themes with delayed fragment responses to hold the skeleton state: dark shows dark-grey placeholders, light shows brand beige, and the header spacing matches in both. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Both new reports fixed in the latest commit (@dotansimha):
|
The modal header re-parents composed children into a .pf-modal-header-content div that is portaled into a top-level dialog, so ancestor selectors through pagefind-modal never matched — and pagefind's stylesheet inflates specificity on these containers with an :is(*, #\#) hack (three ID-level selectors), so equal-specificity overrides lost too. The layout rule now targets the dialog-scoped class with !important: the header stacks input and dropdown with a 12px gap, clearing the input's box-shadow focus ring. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Dropdown/input border overlap fixed in the latest commit — measured 12px of clear space between the input's focus ring and the section trigger now, verified visually in both themes. It resisted three polite attempts first: the modal header re-parents composed children into a |


What
Implements the search feedback from the Slack thread (@dotansimha's "big gap": no breadcrumbs/context, not context-aware, dark-mode blink on result click) plus the remaining production nice-to-haves.
Search (the thread)
Usage Reporting · Routersectiondropdown in the modal header (pagefind's own filter component) is the "other 1%" escape hatch back to all docsshow-sub-resultslists matching headings beneath each page result (up to 3)data-pagefind-body), now guaranteed to stay that way since search is filter-scoped to docs sections…/page/and ate a 301 redirect on every click, which is the main white flash between pages. Aurlmetadata override makes results (and sub-result anchors) link the canonical slash-less URL directly — no hop.ThemeInitalready setscolor-schemeinline before paint, covering the restDark-mode modal, verified headlessly (Router page, query "usage" — note the active
section ⓵filter chip, badges, and sub-results):/docs/router/observability/usage_reporting— no trailing slashNice-to-haves
<lastmod>— derived per page from the git history of content files in one pass (439 of 559 URLs; pages without a content file simply omit it)urlmetadata override aboveNot in this PR (they live in the-guild-org/website): HSTS header and removing the stale
/graphql/hive_astrorouter route — companion PR coming there.Verification
ASTRO_BASE_PATH=/graphql/hivebuild passes the base-path verifier; plain preview build unchanged; typecheck green.🤖 Generated with Claude Code