D0 Part 1: vendored fonts + Lucide sprite + setup CSS fix
- Vendor Plus Jakarta Sans + JetBrains Mono as variable woff2 (latin + latin-ext) under internal/web/static/fonts/, embedded via go:embed and served at /static/fonts/ (font/woff2, immutable cache). Google Fonts @import replaced with @font-face rules preserving unicode-range — removes the CDN dependency that silently broke on offline nodes. - Add templates/icons.html: vendored Lucide sprite (30 icons, symbol ids i-<name>), included at the top of <body> in layout.html. - Fix setup wizard handleCSS: serve the embedded web.StyleCSS() instead of a dataDir-derived filesystem path that never exists in the container (production setup silently served minimalCSS). Fallback to minimalCSS only if the embedded read errors, with a WARN log. - Tests: font route + StyleCSS accessor (web), Scenario E embedded-CSS test (setup; red-proven against the pre-fix handler).
This commit is contained in:
@@ -7,3 +7,13 @@ var templateFS embed.FS
|
||||
|
||||
//go:embed static/chart.min.js
|
||||
var chartJS []byte
|
||||
|
||||
//go:embed static/fonts/*.woff2
|
||||
var fontFS embed.FS
|
||||
|
||||
// StyleCSS returns the embedded dashboard stylesheet. Exported so the setup
|
||||
// wizard can serve the same CSS instead of reading a filesystem path that
|
||||
// does not exist inside the container image.
|
||||
func StyleCSS() ([]byte, error) {
|
||||
return templateFS.ReadFile("templates/style.css")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user