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.
This commit is contained in:
Erik Skopp 2024-08-18 13:31:50 +02:00 committed by GitHub
parent e83c11f31a
commit 852a07b15e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -30,12 +30,11 @@
{{ partialCached "head-css.html" . }}
<!-- Google Analytics -->
{{- if and (eq hugo.Environment "production") (or .Site.GoogleAnalytics .Site.Config.Services.GoogleAnalytics.ID) }}
<link rel="preconnect" href="https://www.googletagmanager.com" crossorigin />
{{ partial "google-analytics.html" . }}
{{- end }}
<!-- Google Analytics -->
{{- if and (eq hugo.Environment "production") .Site.Config.Services.GoogleAnalytics.ID }}
<link rel="preconnect" href="https://www.googletagmanager.com" crossorigin />
{{ partial "google-analytics.html" . }}
{{- end }}
<script>
/* Initialize light/dark mode */