From 14d077743709c393b09a83f4fe302d2b3064fdf1 Mon Sep 17 00:00:00 2001 From: Joao Senger Date: Tue, 11 Jun 2024 10:21:37 -0300 Subject: [PATCH 1/3] feat: googleAnalytics --- .hugo_build.lock | 0 exampleSiteMultilingual/hugo.toml | 6 +++++- layouts/partials/google_analytics.html | 8 ++++++++ layouts/partials/head.html | 4 ++-- 4 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 .hugo_build.lock create mode 100644 layouts/partials/google_analytics.html diff --git a/.hugo_build.lock b/.hugo_build.lock new file mode 100644 index 0000000..e69de29 diff --git a/exampleSiteMultilingual/hugo.toml b/exampleSiteMultilingual/hugo.toml index 7149232..185b37f 100644 --- a/exampleSiteMultilingual/hugo.toml +++ b/exampleSiteMultilingual/hugo.toml @@ -168,4 +168,8 @@ dnt = false id = "e4f661ff-9a8c-49d4-b3cc-2efe553e3973" # Website ID datacache = false url = "https://eu.umami.is/script.js" -shareUrl = "https://eu.umami.is/share/RIETUMwZn4IBMIr8/hugo-theme-anubis2.netlify.app" \ No newline at end of file +shareUrl = "https://eu.umami.is/share/RIETUMwZn4IBMIr8/hugo-theme-anubis2.netlify.app" + +[params.GoogleAnalytics] +enabled = true +gtag = "G-T5LM1515MT" \ No newline at end of file diff --git a/layouts/partials/google_analytics.html b/layouts/partials/google_analytics.html new file mode 100644 index 0000000..9751923 --- /dev/null +++ b/layouts/partials/google_analytics.html @@ -0,0 +1,8 @@ + + + \ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html index ea2de2b..aabe2c7 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -103,8 +103,8 @@ --> -{{ if and (.Site.GoogleAnalytics) (hugo.IsProduction) }} - {{ template "_internal/google_analytics.html" . }} +{{ if (.Site.Params.GoogleAnalytics.enabled) }} + {{ partial "google_analytics.html" . }} {{ end }} {{ if (.Site.Params.UmamiAnalytics.enabled ) }} From 728414737c65cd059ef67e8c3980f5eee493992b Mon Sep 17 00:00:00 2001 From: Joao Senger Date: Tue, 11 Jun 2024 10:27:58 -0300 Subject: [PATCH 2/3] fix: googleAnalytics --- .hugo_build.lock | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .hugo_build.lock diff --git a/.hugo_build.lock b/.hugo_build.lock deleted file mode 100644 index e69de29..0000000 From f5bb357b12fd99f55262672cc38c342dd310553a Mon Sep 17 00:00:00 2001 From: Joao Senger Date: Tue, 11 Jun 2024 10:36:37 -0300 Subject: [PATCH 3/3] fix: gtagexample --- exampleSiteMultilingual/hugo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exampleSiteMultilingual/hugo.toml b/exampleSiteMultilingual/hugo.toml index 185b37f..f8eabb9 100644 --- a/exampleSiteMultilingual/hugo.toml +++ b/exampleSiteMultilingual/hugo.toml @@ -172,4 +172,4 @@ shareUrl = "https://eu.umami.is/share/RIETUMwZn4IBMIr8/hugo-theme-anubis2.netlif [params.GoogleAnalytics] enabled = true -gtag = "G-T5LM1515MT" \ No newline at end of file +gtag = "G-TAGEXAMPLE" \ No newline at end of file