From 233e715e780731bf5721e609eb33df89f659bfd4 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Tue, 17 Sep 2024 07:47:07 +0400 Subject: [PATCH] layouts: fix some deprecations Fix these errors from Hugo: ERROR deprecated: .Site.GoogleAnalytics was deprecated in Hugo v0.120.0 and will be removed in Hugo 0.134.0. Use .Site.Config.Services.GoogleAnalytics.ID instead. ERROR deprecated: .Site.DisqusShortname was deprecated in Hugo v0.120.0 and will be removed in Hugo 0.134.0. Use .Site.Config.Services.Disqus.Shortname instead. --- layouts/_default/baseof.html | 2 +- layouts/_default/single.html | 4 ++-- layouts/partials/cookie-consent.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index e16d319..9a90116 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -31,7 +31,7 @@ {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} {{ end -}} - {{ if .Site.GoogleAnalytics }} + {{ if .Site.Config.Services.GoogleAnalytics.ID }} {{ partial "cookie-consent.html" . }} {{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index d069ecc..d31ea19 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -83,7 +83,7 @@ {{ end }} - {{ if or (ne ($.Param "sharingicons") false) (.Site.DisqusShortname) }} + {{ if or (ne ($.Param "sharingicons") false) (.Site.Config.Services.Disqus.Shortname) }}
diff --git a/layouts/partials/cookie-consent.html b/layouts/partials/cookie-consent.html index 4f1a173..96b5970 100644 --- a/layouts/partials/cookie-consent.html +++ b/layouts/partials/cookie-consent.html @@ -28,7 +28,7 @@ Haven.create({ { name: 'google-analytics', options: { - id: {{ .Site.GoogleAnalytics }}, + id: {{ .Site.Config.Services.GoogleAnalytics.ID }}, }, purposes: ['analytics'], inject: true,