build-base

This commit is contained in:
2026-05-22 06:06:44 +00:00
parent 5a127bf2a2
commit e8f9dea282
38 changed files with 7151 additions and 4 deletions
+22 -1
View File
@@ -1,9 +1,30 @@
// Package assets embeds all web assets (templates + static files) into the binary.
package assets
import "embed"
import (
"embed"
"io/fs"
)
// FS contains all files under the web/ directory.
//
//go:embed web
var FS embed.FS
// AdminFS returns an fs.FS rooted at web/admin — passed to webadmin.Deps.
func AdminFS() fs.FS {
sub, err := fs.Sub(FS, "web/admin")
if err != nil {
panic("assets: web/admin missing: " + err.Error())
}
return sub
}
// ClientFS returns an fs.FS rooted at web/client — passed to webclient.Deps.
func ClientFS() fs.FS {
sub, err := fs.Sub(FS, "web/client")
if err != nil {
panic("assets: web/client missing: " + err.Error())
}
return sub
}