Help us shape the future of Go! Take the 2026 Go Developer Survey

static

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

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

View Source
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

func FS() fs.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

func Handler() http.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.

Jump to

Keyboard shortcuts

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