From 4d5643f8619281e78d930b49c81a08386471edf7 Mon Sep 17 00:00:00 2001 From: Francesco Maida Date: Sat, 16 Mar 2024 17:13:29 +0100 Subject: [PATCH 1/2] Added support for Umami Analytics. See #829 for further references. --- README.md | 2 +- exampleSite/config/_default/params.toml | 4 ++++ layouts/partials/analytics.html | 12 +++++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4786ae4b..d1d772a6 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Congo is designed to be a powerful, lightweight theme for [Hugo](https://gohugo. - Heading anchors, Tables of Contents, Code copy, Buttons, Badges and more - HTML and Emoji support in articles 🎉 - SEO friendly with links for sharing to social media -- Fathom Analytics and Google Analytics support +- Fathom Analytics, Plausible Analytics, Umami Analytics and Google Analytics support - RSS feeds, Favicons and comments support - Advanced customisation using simple Tailwind colour definitions and styles - Optimised for performance and accessibility with perfect Lighthouse scores diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index ad33b74a..0418c986 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -71,6 +71,10 @@ fingerprintAlgorithm = "sha256" [fathomAnalytics] # site = "ABC12345" +#[umamiAnalytics] +# site = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" +# region = "eu" # Can be either "eu" or "us" + [verification] # google = "" # bing = "" diff --git a/layouts/partials/analytics.html b/layouts/partials/analytics.html index a883f28d..10c0ed16 100644 --- a/layouts/partials/analytics.html +++ b/layouts/partials/analytics.html @@ -10,5 +10,15 @@ src="{{ default "https://plausible.io/js/script.js" site.Params.plausibleAnalytics.script }}" > {{ end }} + {{ with site.Params.umamiAnalytics }} + {{- $region := "eu" }} + {{- if isset . "region" }} + {{- $region = .region }} + {{- end }} + + {{ end }} {{ template "_internal/google_analytics.html" . }} -{{ end }} +{{ end }} \ No newline at end of file From c816c5fc3d0456594210669cc5012964ca86c8f9 Mon Sep 17 00:00:00 2001 From: Francesco Maida Date: Sat, 16 Mar 2024 17:28:00 +0100 Subject: [PATCH 2/2] Added support for Umami Analytics :sparkles: See #829 for further references. --- config/_default/params.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/_default/params.toml b/config/_default/params.toml index 82c4d16e..f1d28a78 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -75,6 +75,10 @@ fingerprintAlgorithm = "sha256" # event = "" # script = "" +#[umamiAnalytics] +# site = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" +# region = "eu" # can be either "eu" or "us" + [verification] # google = "" # bing = ""