From 52ddf33f88c4ec11e94d4d77398982d753123a7e Mon Sep 17 00:00:00 2001 From: Augusto Pace Date: Sat, 11 May 2024 20:39:29 +0200 Subject: [PATCH 1/3] feat: added umami analityc support --- README.md | 1 + exampleSite/hugo.yaml | 3 ++ layouts/partials/analytics.html | 96 +++++++++++++++++---------------- 3 files changed, 55 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 8cbe4b81f..d951719b3 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ A [Hugo](https://gohugo.io/) theme for a personal portfolio with minimalist desi - counter.dev - Google Analytics - Matomo/Piwik + - [Umami](https://umami.is/) - Comment Support - [Disqus](https://disqus.com/) - [Valine](https://valine.js.org/) diff --git a/exampleSite/hugo.yaml b/exampleSite/hugo.yaml index e604c33ab..3885fee63 100644 --- a/exampleSite/hugo.yaml +++ b/exampleSite/hugo.yaml @@ -174,6 +174,9 @@ params: # matomo: # instance: matomo.example.com # siteId: 1 # Or any other number + # # Matomo / Piwik + # umami: + # id: # Enable Support support: diff --git a/layouts/partials/analytics.html b/layouts/partials/analytics.html index 2026f01b6..311469acf 100644 --- a/layouts/partials/analytics.html +++ b/layouts/partials/analytics.html @@ -2,55 +2,61 @@ {{ with site.Params.features.analytics }} {{ if or .enable .enabled }} {{ with .services }} - - {{ with .google }} - {{ $privacyConfig:= dict (slice "Site" "Config" "Privacy" "GoogleAnalytics") $.Site.Config.Privacy.GoogleAnalytics }} - {{ $analyticsConfig := dict (slice "Site" "Config" "Services" "GoogleAnalytics" "ID") .id }} - {{ template "_internal/google_analytics.html" (merge $privacyConfig $analyticsConfig) }} - {{ end }} + + {{ with .google }} + {{ $privacyConfig:= dict (slice "Site" "Config" "Privacy" "GoogleAnalytics") $.Site.Config.Privacy.GoogleAnalytics }} + {{ $analyticsConfig := dict (slice "Site" "Config" "Services" "GoogleAnalytics" "ID") .id }} + {{ template "_internal/google_analytics.html" (merge $privacyConfig $analyticsConfig) }} + {{ end }} - - {{ with .counterDev }} - - {{ end }} + + {{ with .counterDev }} + + {{ end }} - - {{ with .goatCounter }} - {{ with .code }} - - {{ else }} - - {{ end }} - {{ end }} + + {{ with .goatCounter }} + {{ with .code }} + + {{ else }} + + {{ end }} + {{ end }} - - {{ with .matomo }} - - - {{ end }} + + {{ with .matomo }} + + + {{ end }} - {{ with .cloudflare }} - - - - {{ end }} + {{ with .cloudflare }} + + + + {{ end }} + + {{ with .umami }} + + + + {{end}} {{ end }} {{ end }} {{ end }} From f7acfb0882dde8e53a66c6c35054b953a67c637e Mon Sep 17 00:00:00 2001 From: Augusto Pace Date: Sun, 12 May 2024 12:42:44 +0200 Subject: [PATCH 2/3] chore: added support to on-premise deployment of umami service --- exampleSite/hugo.yaml | 4 +++- layouts/partials/analytics.html | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/exampleSite/hugo.yaml b/exampleSite/hugo.yaml index 3885fee63..a9093ce44 100644 --- a/exampleSite/hugo.yaml +++ b/exampleSite/hugo.yaml @@ -174,8 +174,10 @@ params: # matomo: # instance: matomo.example.com # siteId: 1 # Or any other number - # # Matomo / Piwik + # # Umami # umami: + # proto: https + # instance: umami.example.com # id: # Enable Support diff --git a/layouts/partials/analytics.html b/layouts/partials/analytics.html index 311469acf..511530261 100644 --- a/layouts/partials/analytics.html +++ b/layouts/partials/analytics.html @@ -54,7 +54,7 @@ {{ with .umami }} - + {{end}} {{ end }} From da97bc15394ec9203aeecc5344bfd4e745170b35 Mon Sep 17 00:00:00 2001 From: Augusto Pace Date: Mon, 13 May 2024 11:12:05 +0200 Subject: [PATCH 3/3] chore: renamed 'proto' to 'scheme' on umami integration --- exampleSite/hugo.yaml | 2 +- layouts/partials/analytics.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/exampleSite/hugo.yaml b/exampleSite/hugo.yaml index a9093ce44..88b75b825 100644 --- a/exampleSite/hugo.yaml +++ b/exampleSite/hugo.yaml @@ -176,7 +176,7 @@ params: # siteId: 1 # Or any other number # # Umami # umami: - # proto: https + # scheme: https # instance: umami.example.com # id: diff --git a/layouts/partials/analytics.html b/layouts/partials/analytics.html index 511530261..a619231e4 100644 --- a/layouts/partials/analytics.html +++ b/layouts/partials/analytics.html @@ -54,7 +54,7 @@ {{ with .umami }} - + {{end}} {{ end }}