Update embedded template system

Just trying to get forward motion. Currently getting a nil Tree inside
the shared template holder.
This commit is contained in:
Eli Ribble 2026-02-07 17:38:49 +00:00
parent 75dba7193a
commit db387ad28b
No known key found for this signature in database
4 changed files with 102 additions and 44 deletions

View file

@ -36,16 +36,15 @@ type templateSystemDisk struct {
func LoadTemplates() error {
_, err := os.Stat("html/template")
if err == nil {
if err != nil {
templates = templateSystemDisk{
sourceFS: os.DirFS("./html/template"),
}
} else {
templates = templateSystemEmbed{
allTemplates: template.New("all"),
sourceFS: embeddedFiles,
templates, err = newTemplateSystemEmbed()
if err != nil {
return fmt.Errorf("Failed to load embedded templates: %w", err)
}
templates.loadAll()
}
return nil
}