diff --git a/.github/workflows/site.yml b/.github/workflows/site.yml index d6de84e..d679816 100644 --- a/.github/workflows/site.yml +++ b/.github/workflows/site.yml @@ -63,6 +63,12 @@ jobs: node --version node scripts/check_floor_parity.mjs _site/example-run.json + # search.js against cases that say what a reader should find first, and + # every search-index.json entry against the page and id it names. Also + # the files the page scripts fetch, which the link check cannot see. + - name: Search ranks as it should, and every index entry resolves + run: node scripts/check_search.mjs _site + # The exact bytes the deploy job publishes. On a pull request this is # also a downloadable preview of the site. - name: Keep the assembled site diff --git a/CHANGELOG.md b/CHANGELOG.md index 35ea855..bac0c8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,12 @@ different event from one that moved because it was wrong. time, so it works with scripts off; `site/site.js` adds only the conveniences and a light, dark, or automatic theme that is remembered between visits. Form borders and the histogram's bars now meet 3:1 contrast in both themes. +- Search across the explainer and every doc, from the header or with `/` or + Ctrl+K. The index (`search-index.json`) is written at build time from the + rendered sections and fetched from the site only when search opens; the + ranking (`site/search.js`) runs in the browser with no library. + `scripts/check_search.mjs` holds the ranking to its cases and every index + entry to a page and id that exist. ### Changed diff --git a/scripts/build_site.py b/scripts/build_site.py index 694fdc1..2c3903a 100644 --- a/scripts/build_site.py +++ b/scripts/build_site.py @@ -20,6 +20,11 @@ came from. Nothing is written by hand and nothing is fetched at runtime, so the pages cannot drift from ``main``: a deploy re-renders them. +``search-index.json`` + Every section of the explainer and the docs as plain text, for the site's + search (``site/search.js``). A reader's browser fetches it only when they + open search, from the site itself. + The example is regenerated from the **mock** adapter and nothing else. The command is read from the report, and anything other than ``--adapter mock`` is refused, so a vendor run can never be published through this path. The run @@ -596,6 +601,7 @@ def social_meta(title: str, description: str, url: str) -> str: Source on GitHub, Apache-2.0 licensed. No analytics, no trackers, no external requests.
+