From 9f9c93a2ccbc0a765b750faf1654dc335a56a3ff Mon Sep 17 00:00:00 2001 From: Andreas Deininger Date: Mon, 4 Mar 2024 14:05:48 +0100 Subject: [PATCH] fix: Disqus deprecation warning, upgrade Hugo version (#166) * fix deprecation warnings regarding disqus * upgrade Hugo version used in Netlify * rename config.toml to hugo.toml --- .gitignore | 2 ++ README.md | 2 +- exampleSite/{config.toml => hugo.toml} | 15 +++++++++------ layouts/partials/comments.html | 2 +- netlify.toml | 2 +- 5 files changed, 14 insertions(+), 9 deletions(-) rename exampleSite/{config.toml => hugo.toml} (98%) diff --git a/.gitignore b/.gitignore index 3df6b55..c0afe96 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .hugo_build.lock +.hvm +exampleSite/public/ exampleSite/resources/ exampleSite/.hugo_build.lock diff --git a/README.md b/README.md index 1875507..d90594d 100644 --- a/README.md +++ b/README.md @@ -205,7 +205,7 @@ Then, edit the `my-first-post.md` file to suit your needs. ### Comments -To enable Disqus comments, set `disqusShortname` in your site's `config.toml`. +To enable Disqus comments, set `services.disqus.shortname` in your site's `hugo.toml`. To use another comments system, provide your own `comments.html` partial in `layouts\partials\comments.html`. diff --git a/exampleSite/config.toml b/exampleSite/hugo.toml similarity index 98% rename from exampleSite/config.toml rename to exampleSite/hugo.toml index 735d693..9832c77 100644 --- a/exampleSite/config.toml +++ b/exampleSite/hugo.toml @@ -9,17 +9,20 @@ theme = "hugo-blog-awesome" # This defines how dates are formatted defaultContentLanguage = "en-gb" -# To enable Google Analytics 4 (gtag.js) provide G-MEASUREMENT_ID below. -# To disable Google Analytics, simply leave the field empty or remove the next line -googleAnalytics = '' # G-MEASUREMENT_ID - # Enable emojis globally enableEmoji = true ignoreErrors = ["additional-script-loading-error"] # ignore error of loading additional scripts. +[services] +# To enable Google Analytics 4 (gtag.js) provide G-MEASUREMENT_ID below. +# To disable Google Analytics, simply leave the field empty or remove the next two lines + [services.googleAnalytics] + id = '' # G-MEASUREMENT_ID + # To enable Disqus comments, provide Disqus Shortname below. -# To disable Disqus comments, simply leave the field empty or remove the next line -disqusShortname = '' +# To disable Disqus comments, simply leave the field empty or remove the next two lines + [services.disqus] + shortname = '' # set markup.highlight.noClasses=false to enable code highlight [markup] diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html index 99efc4b..a5866c8 100644 --- a/layouts/partials/comments.html +++ b/layouts/partials/comments.html @@ -1,4 +1,4 @@ -{{- if .Site.DisqusShortname -}} +{{- if .Site.Config.Services.Disqus.Shortname -}}
{{ template "_internal/disqus.html" . }} {{- end -}} diff --git a/netlify.toml b/netlify.toml index b4511cb..8a370bb 100644 --- a/netlify.toml +++ b/netlify.toml @@ -7,7 +7,7 @@ command = "cd exampleSite && hugo --gc --themesDir ../.." [build.environment] - HUGO_VERSION = "0.116.1" + HUGO_VERSION = "0.122.0" HUGO_THEME = "repo" # Deploy Preview context: all deploys generated from