From f6792dab55382976fdacee75d4189f67900302ee Mon Sep 17 00:00:00 2001 From: Vimux Date: Tue, 12 Dec 2023 11:32:32 -0500 Subject: [PATCH] Fix deprecated config params (GA, Disqus) (#355) 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 5799edaa..70fcd739 100644 --- a/README.md +++ b/README.md @@ -56,8 +56,13 @@ title = "Mainroad" languageCode = "en-us" paginate = "10" # Number of posts per page theme = "mainroad" -disqusShortname = "" # Enable Disqus 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 50b87a77..5b15071a 100644 --- a/layouts/partials/comments.html +++ b/layouts/partials/comments.html @@ -1,4 +1,4 @@ -{{ if and .Site.DisqusShortname (index .Params "comments" | default "true") (not .Site.IsServer) }} +{{ if and .Site.Config.Services.Disqus.Shortname (index .Params "comments" | default "true") (not .Site.IsServer) }}
{{ template "_internal/disqus.html" . }}