package chrome
import (
"embed"
"html/template"
)
//go:embed templates/chrome.tmpl
var templateFS embed.FS
// Attach parses the shared chrome partials ("srht-nav", "srht-env-banner")
// into t, so a service layout can invoke them. Call it once per template set,
// before the layout that references the partials is executed.
func Attach(t *template.Template) (*template.Template, error) {
return t.ParseFS(templateFS, "templates/chrome.tmpl")
}
// MustAttach is Attach for the common wire-up-at-startup path, where a parse
// failure is a programmer error.
func MustAttach(t *template.Template) *template.Template {
t, err := Attach(t)
if err != nil {
panic(err)
}
return t
}