From 2558f6bbde56c52793c312b1d9b484108697d5c1 Mon Sep 17 00:00:00 2001 From: Vimux Date: Sat, 9 Dec 2023 14:04:44 -0500 Subject: [PATCH] Fix deprecated config params (GA, Disqus) (#89) As of Hugo 0.120.0, `.Site.disqusShortname` and `.Site.googleAnalytics` are deprecated. Backward compatible change, new notation supported from Hugo v0.41. See https://github.com/gohugoio/hugo/commit/4ddcf52ccc7af3e23109ebaac1f0486087a212ba --- README.md | 9 +++++++-- layouts/partials/comments.html | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1476767..ec56db5 100644 --- a/README.md +++ b/README.md @@ -123,8 +123,13 @@ title = "Binario" languageCode = "en-us" paginate = "10" # Number of elements per page in pagination theme = "binario" -disqusShortname = "" # Enable comments by entering your Disqus shortname -googleAnalytics = "" # Enable Google Analytics by entering your tracking id +disqusShortname = "" # DEPRECATED! Use .Services.Disqus.Shortname +googleAnalytics = "" # DEPRECATED! Use .Services.googleAnalytics.ID + +[services.disqus] + shortname = "" # Enable Disqus by entering your Disqus shortname +[services.googleAnalytics] + ID = "" # Enable Google Analytics by entering your tracking ID [Author] # Used in authorbox name = "John Doe" diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html index 1678d60..7e065ec 100644 --- a/layouts/partials/comments.html +++ b/layouts/partials/comments.html @@ -1,4 +1,4 @@ -{{ if and (.Site.DisqusShortname) (.Param "comments") (not .Site.IsServer) }} +{{ if and (.Site.Config.Services.Disqus.Shortname) (.Param "comments") (not .Site.IsServer) }}
{{ template "_internal/disqus.html" . }}