From e151ecbee81e69287836407f6a88477221c8c4f1 Mon Sep 17 00:00:00 2001 From: Andreas Deininger Date: Wed, 9 Oct 2024 23:36:12 +0200 Subject: [PATCH] Fix deprecation warnings emitted by hugo (#406) --- README.md | 12 ++++++++---- exampleSite/config.toml | 13 ++++++++----- layouts/_default/single.html | 2 +- layouts/partials/page.html | 2 +- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index d1e056e7a..3c3051e20 100644 --- a/README.md +++ b/README.md @@ -113,10 +113,12 @@ There is the possibility to override the CSS and set your custom styles, overrid The optional comments system is powered by [Disqus](https://disqus.com). If you want to enable comments, create an account in Disqus and write down your shortname. ```toml -disqusShortname = "devcows" +[services] +[services.disqus] +Shortname = "devcows" ``` -You can disable the comments system by leaving the `disqusShortname` empty. +You can disable the comments system by leaving the `Shortname` empty. ### Google Analytics @@ -124,10 +126,12 @@ You can disable the comments system by leaving the `disqusShortname` empty. You can optionally enable Google Analytics. Type your tracking code in the ``. ```toml -googleAnalytics = "UA-XXXXX-X" +[services] +[services.googleAnalytics] +id = "UA-XXXXX-X" ``` -Leave the `googleAnalytics` key empty to disable it. +Leave the `id` key empty to disable it. ### Logo diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 51fd46a9a..00703c8ba 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -5,10 +5,6 @@ themesDir = "../.." languageCode = "en-us" # Site language. Available translations in the theme's `/i18n` directory. defaultContentLanguage = "en" -# Enable comments by entering your Disqus shortname -disqusShortname = "devcows" -# Enable Google Analytics by entering your tracking code -googleAnalytics = "" # number of words of summarized post content (default 70) summaryLength = 70 @@ -19,8 +15,15 @@ paginate = 10 # not pluralize title pages by default pluralizelisttitles = false -[menu] +[services] +[services.disqus] +# Enable comments by entering your Disqus shortname +Shortname = "devcows" +[services.googleAnalytics] +# Enable Google Analytics by entering your tracking code +id = "" +[menu] # Main menu [[menu.main]] diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 88bf6410f..269e038fe 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -45,7 +45,7 @@ {{ .Content }} - {{ if .Site.DisqusShortname }} + {{ if .Site.Config.Services.Disqus.Shortname }}
{{ template "_internal/disqus.html" . }}
diff --git a/layouts/partials/page.html b/layouts/partials/page.html index e0eb4df44..091bec9b1 100644 --- a/layouts/partials/page.html +++ b/layouts/partials/page.html @@ -2,7 +2,7 @@
{{ .Content }} - {{ if .Site.DisqusShortname }} + {{ if .Site.Config.Services.Disqus.Shortname }}
{{ template "_internal/disqus.html" . }}