From 852a07b15ea1910e300b6cb341dfcb0a7e03c3a8 Mon Sep 17 00:00:00 2001
From: Erik Skopp <129506395+eskopp@users.noreply.github.com>
Date: Sun, 18 Aug 2024 13:31:50 +0200
Subject: [PATCH] fix: remove deprecated google analytics reference in
head.html (#435)
ERROR deprecated: .Site.GoogleAnalytics was deprecated in Hugo v0.120.0 and will be removed in Hugo 0.133.0. Use .Site.Config.Services.GoogleAnalytics.ID instead.
---
layouts/partials/head.html | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index ebaab67a..5c27e860 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -30,12 +30,11 @@
{{ partialCached "head-css.html" . }}
-
- {{- if and (eq hugo.Environment "production") (or .Site.GoogleAnalytics .Site.Config.Services.GoogleAnalytics.ID) }}
-
- {{ partial "google-analytics.html" . }}
- {{- end }}
-
+
+{{- if and (eq hugo.Environment "production") .Site.Config.Services.GoogleAnalytics.ID }}
+
+ {{ partial "google-analytics.html" . }}
+{{- end }}