Added option to hot reload templates for development.

This commit is contained in:
Marvin Blum
2019-12-27 20:24:24 +01:00
parent ef1223b4aa
commit 53e7d6dcf4
4 changed files with 41 additions and 10 deletions

View File

@@ -5,6 +5,7 @@ import (
"github.com/emvi/logbuch"
"os"
"path/filepath"
"strings"
)
const (
@@ -18,7 +19,7 @@ var (
)
func LoadTemplates() {
tplCache = util.NewTemplateCache()
tplCache = util.NewTemplateCache(strings.ToLower(os.Getenv("SCHNITTFEST_HOT_RELOAD")) == "true")
templateBase := os.Getenv("SCHNITTFEST_TEMPLATE_BASE")
if templateBase == "" {