diff --git a/config/_default/module.toml b/config/_default/module.toml index f13256c..0ca820b 100644 --- a/config/_default/module.toml +++ b/config/_default/module.toml @@ -1,2 +1,4 @@ [[imports]] path = "github.com/CaiJimmy/hugo-theme-stack/v3" +[[imports]] +path = 'github.com/hugomods/umami-analytics' diff --git a/config/_default/params.toml b/config/_default/params.toml index 581d36e..e6e33de 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -83,3 +83,8 @@ provider = "cactus" defaultHomeserverUrl = "https://matrix.cactus.chat:8448" serverName = "cactus.chat" siteName = "" + +[services] +[services.umami_analytics] +id = 'bce05e76-5cae-4688-a389-99bb87649d44' +script_url = 'https://umami.martin.md/script.js' diff --git a/go.mod b/go.mod index 038ef8b..0cfdf11 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,7 @@ module github.com/CaiJimmy/hugo-theme-stack-starter go 1.17 -require github.com/CaiJimmy/hugo-theme-stack/v3 v3.30.0 // indirect +require ( + github.com/CaiJimmy/hugo-theme-stack/v3 v3.30.0 // indirect + github.com/hugomods/umami-analytics v0.3.1 // indirect +) diff --git a/go.sum b/go.sum index df9ea52..959ea82 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,4 @@ github.com/CaiJimmy/hugo-theme-stack/v3 v3.30.0 h1:uITC7EKGyfPjyi3C5At++E0Uu1qQXtqiwMV4pd7LkLs= github.com/CaiJimmy/hugo-theme-stack/v3 v3.30.0/go.mod h1:IPmCXiIxlFSLFYS0tOmYP6ySLviyeNVSabyvSuaxD+I= +github.com/hugomods/umami-analytics v0.3.1 h1:C4B1oKRBvCRamH3muiWK+QNbehmxd+7DiK80jHCdMJo= +github.com/hugomods/umami-analytics v0.3.1/go.mod h1:nlZGLPH5L+H25+HwmuzHsEfM869+tMTUTcSUBcOQEm4= diff --git a/layouts/partials/head/custom.html b/layouts/partials/head/custom.html new file mode 100644 index 0000000..02454ed --- /dev/null +++ b/layouts/partials/head/custom.html @@ -0,0 +1,3 @@ +{{ if hugo.IsProduction }} +{{ partialCached "hugomods/umami-analytics/index" . .Params.analyze }} +{{ end }}