package templates import ( "io/fs" "go.alanpearce.eu/website/internal/config" ) var ( css string ) func Setup() { bytes, err := fs.ReadFile(Files, "style.css") if err != nil { panic(err) } css = string(bytes) } type PageSettings struct { Title string Path string TitleAttrs templ.Attributes BodyAttrs templ.Attributes } func extendClasses(cs string, attrs templ.Attributes) string { if extras, exists := attrs["class"]; exists { return templ.Classes(cs, extras).String() } else { return cs } } templ menuItem(item config.MenuItem) { { item.Name } } templ Page(site *config.Config, page PageSettings) {