Rustelo/templates/shared/public/scripts/README.md
2026-07-18 19:57:03 +01:00

22 lines
1.1 KiB
Markdown

# Shared client scripts (htmx-ssr glue)
Base client scripts for the `htmx-ssr` render profile. The `website-htmx-ssr`
template pulls these into a site's `site/public/js/`. The `htmx.min.js` library
and extensions live in `templates/shared/htmx/`.
## Load order
1. `theme-init.js` — inline in `<head>` before first paint (no-flash). Minify for inlining.
2. `htmx.min.js` + needed extensions (from `../htmx/`).
3. Feature libraries when used: `hljs` (highlight bundle), `cytoscape`, content-graph.
4. `htmx-reinit.js` — defines `window.RusteloReinit` (must precede handlers).
5. `reinit-handlers.js` — registers `highlight` / `theme` / `tag-filters` / `content-graph`.
6. `tag-filters.js`, `highlight-utils.js` — provide the globals the handlers call.
Handlers feature-detect and no-op when a library is absent, so a site that omits
cytoscape/content-graph drops those libs without touching this glue.
## Provenance
Promoted from `jpl-website/site/public/js`. Snapshot, not a live mirror — when
jpl-website's glue evolves, re-promote (tracked as a backlog item).