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:
parent
75dba7193a
commit
db387ad28b
4 changed files with 102 additions and 44 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue