From d29e4da3e683a4c17c609ace5dd92cd2126b1ed9 Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sun, 19 Jun 2022 00:39:44 +0200 Subject: Add support for Global site tag (gtag.js) - Google Analytics --- layouts/partials/data.html | 7 +++++++ layouts/partials/head.html | 13 ++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 layouts/partials/data.html (limited to 'layouts/partials') diff --git a/layouts/partials/data.html b/layouts/partials/data.html new file mode 100644 index 0000000..4eedc7b --- /dev/null +++ b/layouts/partials/data.html @@ -0,0 +1,7 @@ + diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 0c9329d..e77e902 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -11,7 +11,8 @@ {{ hugo.Generator }} - {{- partial "styles.html" . }} + {{ partial "styles.html" . }} + {{ partial "data.html" . }} {{ block "custom-scripts" . }}{{ partial "custom-scripts.html" . }}{{ end }} {{- /* Favicons */}} @@ -29,6 +30,16 @@ {{ block "custom-head" . }}{{ partial "custom-head.html" . }}{{ end }} + {{ with site.GoogleAnalytics }} + {{ $ga := resources.Get "js/ga.js" | minify | fingerprint }} + {{ if not site.Params.assets.disable_fingerprinting }} + {{ $ga = $ga | fingerprint }} + + {{ else }} + + {{ end }} + {{ end }} + {{- /* Misc */}} {{ template "partials/templates/opengraph.html" . }} {{ template "partials/templates/twitter_cards.html" . }} -- cgit v1.2.3