diff --git a/internal/pkg/config/default.go b/internal/pkg/config/default.go index a535fec..73e7808 100644 --- a/internal/pkg/config/default.go +++ b/internal/pkg/config/default.go @@ -10,8 +10,9 @@ func Default() Cfg { CacheLifetime: time.Hour * 24 * 31, }, Tracking: &Umami{ - ScriptSrc: "https://umami.schreifuchs.ch/script.js", - WebsiteID: "54d8a379-77d5-4c20-b46d-5c9a6c9e39bd", + ScriptSrc: "https://umami.schreifuchs.ch/script.js", + RecorderSrc: "https://umami.schreifuchs.ch/recorder.js", + WebsiteID: "54d8a379-77d5-4c20-b46d-5c9a6c9e39bd", }, Gallery: &Gallery{ Path: "photos", diff --git a/internal/pkg/config/resource.go b/internal/pkg/config/resource.go index ebe27e9..922be12 100644 --- a/internal/pkg/config/resource.go +++ b/internal/pkg/config/resource.go @@ -52,7 +52,9 @@ type Gallery struct { } type Umami struct { - ScriptSrc string `env:"SCRIPT_SRC"` + ScriptSrc string `env:"SCRIPT_SRC"` + RecorderSrc string `env:"RECORDER_SRC"` + WebsiteID string `env:"WEBSITE_ID"` } diff --git a/web/layouts/base.templ b/web/layouts/base.templ index 32187af..f85a1b3 100644 --- a/web/layouts/base.templ +++ b/web/layouts/base.templ @@ -20,6 +20,10 @@ templ head(cfg config.Cfg, title string) { + if cfg.Tracking.RecorderSrc != "" { + + } + for _, h := range templer.GetHeader(ctx) { @templ.Raw(h) }