Documentation
¶
Overview ¶
Package static embeds the Hearth shell's self-hosted fonts and vendored JS (Hanken Grotesk, Space Mono, HTMX, Alpine) so both apps ship them from the nestcore binary rather than each keeping its own copy. Embedding — not a CDN link — is load-bearing: the appliance must render with the internet down (see housedev's top-level CLAUDE.md, "No page may request an external host").
Index ¶
Constants ¶
const MountPath = "/hearth-static/"
MountPath is the path the consuming app's mux must mount Handler under. ui/css/base.css and ui/components's Layout hardcode asset URLs against this exact prefix, so an app that mounts the handler elsewhere breaks both.
Variables ¶
This section is empty.
Functions ¶
func FS ¶
FS returns the embedded assets rooted so that, e.g., "fonts/hanken-grotesk.woff2" resolves to ui/static/fonts/hanken-grotesk.woff2.
func Handler ¶
Handler serves the embedded assets. Mount it at MountPath:
mux.Handle(static.MountPath, http.StripPrefix(static.MountPath, static.Handler()))
Responses carry a long-lived immutable Cache-Control header — the assets are baked into the binary at build time and never change under a running process — and directory requests 404 rather than listing the embedded fonts/js trees.
Types ¶
This section is empty.