The subscribe modal (shared across the book, site, labs, kits, and
mlsysim subsites) was a plain div overlay:
- No role="dialog", aria-modal, or accessible name, so screen readers
never announced it as a dialog and could wander into the page
behind the overlay.
- No focus trap: Tab walked out of the modal into the visually hidden
background page.
- Focus was never returned to the triggering element on close, dropping
keyboard users at the top of the document.
- Open/close animations played regardless of prefers-reduced-motion.
Changes to the canonical shared/scripts/subscribe-modal.js:
- role="dialog" aria-modal="true" aria-labelledby on the container,
with an id on the existing title.
- Tab/Shift+Tab now cycle within the modal's visible, enabled controls
(computed per keypress, so the trap also works on the post-submit
success view).
- The opener element is saved on openModal() and refocused on close.
- Animations are disabled under prefers-reduced-motion: reduce.
Mirrors regenerated with shared/scripts/sync-mirrors.sh (CI drift
check). Escape-to-close and overlay-click behavior unchanged.
Brings the TinyTorch lab guide's Quarto project in line with
book/quarto/, the only other in-tree Quarto publication that builds
both web and PDF outputs from a single source. The previous name had
three redundancies:
- already under tinytorch/, so "site-" prefix wasn't disambiguating
- also produces the PDF lab guide, so "site-" was misleading
- the top-level site/ dir made "site-quarto" read as "the site's
quarto config" rather than "the tinytorch site, in quarto"
After this rename the convention is straightforward:
book/quarto/ -> the textbook (web + PDF)
tinytorch/quarto/ -> the TinyTorch lab guide (web + PDF)
mlsysim/docs/ -> mlsysim API reference (kept as docs/, since it
really is API reference, not a publication)
Touches 7 GitHub workflows, both .gitignore files, the rename target's
own self-references (Makefile, _quarto.yml configs, STYLE.md,
measure-pdf-images.py), and 6 copies of subscribe-modal.js plus a few
shared scripts/configs whose comments documented the old path.
Verified: rebuilt pdf/TinyTorch-Guide.pdf (2.1M) cleanly from the new
location with 'make pdf' from tinytorch/quarto/.
Quarto's resource-copy step preserves symlinks rather than dereferencing
them, which breaks both local builds (AlreadyExists on the second pass)
and gh-pages deploys (relative symlink targets fall outside _build/).
And Sass resolves @import relative to the importing file's physical
location, not the symlink target. So symlinks inside the resource path
are not a viable dedup mechanism.
Instead, keep real file copies in each consumer subsite and enforce
dedup at edit time with shared/scripts/sync-mirrors.sh:
- bash shared/scripts/sync-mirrors.sh # propagate canonicals
- bash shared/scripts/sync-mirrors.sh --check # CI: fail on drift
Mirror map (source | mirrors):
shared/scripts/subscribe-modal.js -> {site, book/quarto, labs, kits,
mlsysim/docs}/.../subscribe-modal.js
Intentional non-mirrors (left untouched, customized variants):
tinytorch/site-quarto/assets/scripts/subscribe-modal.js (TinyTorch-branded)
tinytorch/site/_static/subscribe-modal.js (legacy Sphinx)
Also dedupe the SocratiQ widget bundle via a symlink (safe here because
book/tools/ sits outside any Quarto project, so the resource walker
never touches it):
book/tools/scripts/socratiQ/bundle.js -> ../../../quarto/tools/scripts/socratiQ/bundle.js
The shared canonical (book/quarto/tools/scripts/socratiQ/bundle.js) is
the version actually referenced and served in production.
Add subscribe-modal.js and Subscribe navbar button to MLSYSIM docs
site, matching the unified navbar pattern across all components
(Labs, Kits, MLSYSIM). Right-side items now follow the same order:
Downloads, Star, Support, Subscribe, GitHub.