Documentation
¶
Overview ¶
Package web embeds the dashboard's static assets (hand-written CSS/JS plus the vendored, version-pinned HTMX, HTMX SSE extension and Alpine.js builds — golden rule 7: no CDN, no SPA framework) and serves them with content-hashed, immutable cache URLs.
Index ¶
Constants ¶
const StaticPrefix = "/static/"
StaticPrefix is the URL path prefix assets are served under.
Variables ¶
var Static embed.FS
Static holds everything under web/static: app.css, app.js and vendor/*.
Functions ¶
func Asset ¶
Asset returns the URL for an embedded asset with its content hash as a cache-busting query string, e.g. /static/app.css?v=0123456789abcdef. Unknown names yield a plain /static/ URL, which ServeAsset answers with 404.
func ServeAsset ¶
func ServeAsset(w http.ResponseWriter, r *http.Request, name string)
ServeAsset writes the embedded asset called name (relative to static/). When the request's ?v= matches the current content hash the response is cacheable forever (immutable); otherwise it is served uncached so a stale URL never pins an old file in a browser cache.
Types ¶
This section is empty.