Skip to content

Add Pagefind search runtime core#20

Open
ritorhymes wants to merge 4 commits into
eips-wg:masterfrom
ritovision:search-runtime-core
Open

Add Pagefind search runtime core#20
ritorhymes wants to merge 4 commits into
eips-wg:masterfrom
ritovision:search-runtime-core

Conversation

@ritorhymes

@ritorhymes ritorhymes commented May 18, 2026

Copy link
Copy Markdown

Built on top of the v2 multi-repo local build system #15.

Part of the Pagefind search rollout coordinated in eips-wg/preprocessor#39. This PR is stacked on #19, which adds the search route templates and Pagefind indexing hooks. This PR adds the browser runtime core; the complete user-facing full search experience requires #21, #22, #23, and #24 on top of this runtime.

Description

Replaces the old Fuse browser search runtime with a Pagefind-backed runtime core.

This also makes full-search URLs shareable and bookmarkable by syncing committed query and sort state into the address bar.

Demo site: wg-eips.ritovision.com/search

  • Adds loader.mjs as the single browser Pagefind API boundary.
  • Splits the old monolithic search script into focused modules for configuration, constants, DOM helpers, loading, modal search, full-page search, and result rendering.
  • Rebuilds quick search against Pagefind while preserving the modal search entry point.
  • Adds the full search page runtime shell: query state synced to the URL, sort control with the final five options, status region, result rendering, and share-link button behavior.
  • Keeps share-link copy success and failure feedback on the icon state instead of rewriting the result status text.
  • Updates the base template to expose resolved search state as global JSON config for client JavaScript.
  • Makes the global header search trigger a real /search/ link.
  • Moves search UI styles into a dedicated stylesheet so the UI can render from CSS instead of being injected by JavaScript after startup.
  • Adds search UI validation coverage for the Pagefind loader boundary, quick search modal, share icon state, and full search runtime shell.

This PR does not add the final full-search filter controls, Created Date filtering, pagination, last-search restore, or the full validation hardening pass. Those land in the remaining stacked theme PRs.

Render external requires entries as direct links without forcing Zola to
resolve them as local pages.

This supports targeted --only rendering, where cross-repo proposal
dependencies can be rewritten to external URLs instead of local pages.

Move the theme demo homepage badges into front matter, a homepage_badges
macro, and theme-owned styles so the demo homepage stays
markdown-friendly.

Declare Zola 0.22.1 as the minimum supported version, enable bottom
footnotes, and update markdown highlighting to the class-based config
with github-light/dark themes and ABNF/CSL-JSON grammars.
Add POSIX and PowerShell setup scripts for theme contributors that
reuse or install build-eips, ensure a supported Zola is available, and
bootstrap the surrounding workspace through an active proposal repo.

Document the theme local development workflow, including workspace
layout, setup flags, serve versus preview, server/base URL settings,
targeted rendering, and source/output overrides.

Keep this focused on setup and documentation; theme rendering behavior
continues to be owned by the earlier theme PR.
Add the generated search route page and inert search state fallback
chain. The theme ships data/build_eips_search.toml with enabled = false
and a [extra.search] block in theme.toml. base.html prefers the project
data file when build-eips has written one and falls back to the
theme-level config for standalone theme consumption. The search route
renders the mount, embeds search state as JSON for later runtime code,
and shows a disabled-state message when search is off. No Pagefind
browser assets are loaded here.

Add the generated search route to the header navigation with a normal
text link so desktop and mobile navigation have the route as soon as the
route exists.

Add the Pagefind indexing contract on proposal rendering. Mark the
proposal article as the data-pagefind-body region and mark repeated
chrome as data-pagefind-ignore, so the index covers proposal prose
rather than taxonomy badges, preamble tables, the table of contents,
status callouts, links, citations, or other repeated UI. Emit Pagefind
filters for derived proposal_category, status, name-only authors, and
created_year; meta for proposal id, title, description, status, type,
category, author display strings, and created date; and sort keys for
number and created date.

Read the canonical proposal id from page.extra.proposal_id on rendered
proposal pages, and add proposal_id values to the committed theme
fixtures so standalone theme rendering produces the same ids that
build-eips will write.

Add two validation scripts. scripts/check-search-template covers the
fallback chain by building downstream Zola fixtures for missing project
data and project override cases. scripts/check-pagefind-indexing-hooks
runs real Pagefind against rendered output and asserts that /search/,
home, taxonomy pages, generic pages, and repeated chrome do not appear
in the index.
Replace the old Fuse search runtime with Pagefind-backed browser search.

Add a loader module as the single Pagefind API boundary. The loader
imports the configured Pagefind bundle, sets basePath, baseUrl, and
excerptLength, initializes once, and serves both search surfaces. Split
the prior monolithic search.mjs into focused modules for config,
constants, DOM helpers, loading, modal search, full-page search, and
result rendering. Rebuild the quick search modal against the new loader
with the final keyword/phrase copy and modal layout.

Wire the full search page runtime shell with query state, the
relevance/number/created sort contract, a status region, a results
region, and the final share-link icon button. The share button keeps
copy success or failure feedback on the icon state instead of rewriting
the result status text.

Update base.html to expose resolved search state as a JSON config script
for client JavaScript, make the global header search trigger a real
/search/ link, and load search UI styles from a dedicated stylesheet
instead of injecting them from JavaScript after startup.

Add check-pagefind-search-ui coverage for the loader boundary, quick
search modal, share icon state, and full search runtime shell against
rendered output.
@ritorhymes ritorhymes force-pushed the search-runtime-core branch from 2532401 to 7cc239d Compare May 20, 2026 13:13
@ritorhymes ritorhymes marked this pull request as ready for review May 20, 2026 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant