1
0
mirror of https://github.com/raseels-repos/golang-saas-starter-kit.git synced 2025-08-10 22:41:25 +02:00

issue #29 fixed hot reload of html templates

services had env vars resolving to directories not being watched by
fresh
This commit is contained in:
Lee Brown
2020-01-18 13:21:35 -09:00
parent def18c3150
commit daccf4074a
5 changed files with 34 additions and 24 deletions

View File

@@ -217,6 +217,9 @@ func NewTemplateRenderer(templateDir string, enableHotReload bool, globalViewDat
// Recursively loop through all folders/files in the template directory and group them by their
// template type. They are filename / filepath for lookup on render.
err := filepath.Walk(templateDir, func(path string, info os.FileInfo, err error) error {
if err != nil {
return errors.WithMessagef(err, "Failed to list directory %s", path)
}
dir := filepath.Base(filepath.Dir(path))
// Skip directories.