diff --git a/web/web.go b/web/web.go index 452ed48..3547b85 100644 --- a/web/web.go +++ b/web/web.go @@ -9,6 +9,7 @@ import ( "html/template" "io/fs" "net/http" + "os" "strings" "github.com/ClusterCockpit/cc-backend/internal/auth" @@ -46,6 +47,23 @@ func init() { return nil } + if path == "templates/imprint.tmpl" { + if _, err := os.Stat("./var/imprint.tmpl"); err == nil { + log.Info("overwrite imprint.tmpl with local file") + templates[strings.TrimPrefix(path, "templates/")] = + template.Must(template.Must(base.Clone()).ParseFiles("./var/imprint.tmpl")) + return nil + } + } + if path == "templates/privacy.tmpl" { + if _, err := os.Stat("./var/privacy.tmpl"); err == nil { + log.Info("overwrite privacy.tmpl with local file") + templates[strings.TrimPrefix(path, "templates/")] = + template.Must(template.Must(base.Clone()).ParseFiles("./var/privacy.tmpl")) + return nil + } + } + templates[strings.TrimPrefix(path, "templates/")] = template.Must(template.Must(base.Clone()).ParseFS(templateFiles, path)) return nil }); err != nil {