web

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

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

View Source
const StaticPrefix = "/static/"

StaticPrefix is the URL path prefix assets are served under.

Variables

View Source
var Static embed.FS

Static holds everything under web/static: app.css, app.js and vendor/*.

Functions

func Asset

func Asset(name string) string

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.

func Sum256

func Sum256(name string) (string, error)

Sum256 returns the lowercase hex SHA-256 of an embedded file (used by the manifest test and by operators verifying the vendored assets against web/static/vendor/VERSIONS).

Types

This section is empty.

Directories

Path Synopsis
templ: version: v0.3.1020
templ: version: v0.3.1020

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL