From 005afbf04542645ad7238f4a0f635993842b335a Mon Sep 17 00:00:00 2001 From: Jan Fader Date: Sat, 13 Aug 2022 08:41:36 +0200 Subject: [PATCH 1/2] add support for umami --- README.md | 6 ++++++ layouts/partials/head.html | 4 ++++ layouts/partials/umami_analytics.html | 3 +++ 3 files changed, 13 insertions(+) create mode 100644 layouts/partials/umami_analytics.html diff --git a/README.md b/README.md index 47c3c0c..add1129 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ Anubis is a simple minimalist theme for [Hugo blog engine](https://gohugo.io/). - Mobile support - Social icons - Google Analytics +- Umami Analytics - Comment systems: Disqus, ISSO, Utteranc.es, GraphComment - RSS feeds - Related posts (Read Next section) @@ -119,6 +120,11 @@ params: avatar: true # optional avatar-bg: "#f0f0f0" # optional feed: false # optional + UmamiAnalytics: + enabled: true # mandatory + dnt: true # optional + id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # mandatory + datacache: false # optional graphcommentId: "" webmentions: url: https://yourdomain.com/webemntions/receive diff --git a/layouts/partials/head.html b/layouts/partials/head.html index ea98f1a..b8da3ac 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -72,4 +72,8 @@ {{ template "_internal/google_analytics.html" . }} {{ end }} +{{ if (.Site.Params.UmamiAnalytics.enabled ) }} + {{ partial "umami_analytics.html" . }} +{{ end }} + {{ partial "head-extra.html" . }} diff --git a/layouts/partials/umami_analytics.html b/layouts/partials/umami_analytics.html new file mode 100644 index 0000000..9a531c1 --- /dev/null +++ b/layouts/partials/umami_analytics.html @@ -0,0 +1,3 @@ +{{ $dnt := .Site.Params.UmamiAnalytics.dnt | default "false" }} +{{ $datacache := .Site.Params.UmamiAnalytics.datacache | default "false" }} + From 3ffaa7651fb5e827a3343aeea07c23df99d5542d Mon Sep 17 00:00:00 2001 From: Jan Fader Date: Sat, 13 Aug 2022 08:45:43 +0200 Subject: [PATCH 2/2] add missing url for umami --- README.md | 1 + layouts/partials/umami_analytics.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index add1129..0c88ea8 100644 --- a/README.md +++ b/README.md @@ -125,6 +125,7 @@ params: dnt: true # optional id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # mandatory datacache: false # optional + url: "https://abc.example.com/umami.js" # mandatory graphcommentId: "" webmentions: url: https://yourdomain.com/webemntions/receive diff --git a/layouts/partials/umami_analytics.html b/layouts/partials/umami_analytics.html index 9a531c1..e0d84b9 100644 --- a/layouts/partials/umami_analytics.html +++ b/layouts/partials/umami_analytics.html @@ -1,3 +1,3 @@ {{ $dnt := .Site.Params.UmamiAnalytics.dnt | default "false" }} {{ $datacache := .Site.Params.UmamiAnalytics.datacache | default "false" }} - +