From 4435557b80dd5b8f9ff5a391fb9a128254c13ffb Mon Sep 17 00:00:00 2001
From: Alexander Bilz <mail@alexbilz.com>
Date: Thu, 18 Jul 2024 16:25:33 +0000
Subject: [PATCH] fix: deprecation warnings for recent Hugo versions (#511)

---
 .devcontainer/Dockerfile                         |    2 +-
 layouts/_default/single.html                     |    2 +-
 exampleSite/content/english/post/rich-content.md |    2 +-
 exampleSite/config/_default/config.toml          |   12 ++++++++----
 netlify.toml                                     |    2 +-
 layouts/partials/footer.html                     |    2 +-
 6 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
index 960e283..ba42825 100644
--- a/.devcontainer/Dockerfile
+++ b/.devcontainer/Dockerfile
@@ -3,7 +3,7 @@
 FROM mcr.microsoft.com/devcontainers/javascript-node:${NODE_VERSION}
 
 # VARIANT can be either 'hugo' for the standard version or 'hugo_extended' for the extended version.
-ARG VARIANT=hugo
+ARG VARIANT=hugo_extended
 # VERSION can be either 'latest' or a specific version number
 ARG VERSION=latest
 
diff --git a/exampleSite/config/_default/config.toml b/exampleSite/config/_default/config.toml
index f39e07e..890025d 100644
--- a/exampleSite/config/_default/config.toml
+++ b/exampleSite/config/_default/config.toml
@@ -12,11 +12,7 @@
 enableEmoji = true
 enableRobotsTXT = true
 
-# Enable Disqus
-#disqusShortname = ""
 
-# Google Analytics
-#googleAnalytics = "UA-123-45"
 
 # Syntax highlighting
 pygmentsUseClasses = true   
@@ -46,3 +42,11 @@
 [[related.indices]]
   name = 'tags'
   weight = 80
+
+[services]
+# Enable Disqus.Disqus.Shortname
+  [services.disqus]
+    #shortname = 'your-disqus-shortname'
+# Google Analytics
+  [services.googleAnalytics]
+    #ID = 'G-MEASUREMENT_ID'
diff --git a/exampleSite/content/english/post/rich-content.md b/exampleSite/content/english/post/rich-content.md
index f091773..8026978 100644
--- a/exampleSite/content/english/post/rich-content.md
+++ b/exampleSite/content/english/post/rich-content.md
@@ -23,7 +23,7 @@
 
 ## Twitter Simple Shortcode
 
-{{< twitter_simple 1085870671291310081 >}}
+{{< twitter user="SanDiegoZoo" id="1453110110599868418" >}}
 
 <br>
 
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index acaad3f..f09fd30 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -77,7 +77,7 @@
     </div>
 
     {{ if and (or (eq .Type "post") (eq .Type .Site.Params.postSectionName)) (ne .Page.Params.disableComments true) }}
-      {{- if .Site.DisqusShortname -}}
+      {{- if .Site.Config.Services.Disqus.Shortname -}}
         <div id="comment">
           <h2>{{ i18n "comments" }}</h2>
           {{ template "_internal/disqus.html" . }}
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index e3f6ed5..ba2de22 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -27,7 +27,7 @@
 </footer>
 {{- partial "medium-zoom.html" .context -}}
 {{- partial "math.html" .context -}}
-{{- if (hasPrefix .context.Site.GoogleAnalytics "G-") -}}
+{{- if (hasPrefix .context.Site.Config.Services.GoogleAnalytics.ID "G-") -}}
   {{- template "_internal/google_analytics.html" .context -}}
 {{- end -}}
 {{- if and (hugo.IsProduction) (.context.Site.Params.gtagId) -}}
diff --git a/netlify.toml b/netlify.toml
index c71d1d2..f3d0dce 100644
--- a/netlify.toml
+++ b/netlify.toml
@@ -3,7 +3,7 @@
   command = "cd exampleSite && hugo --gc --minify --themesDir ../.."
   
 [build.environment]
-  HUGO_VERSION = "0.69.0"
+  HUGO_VERSION = "0.128.0"
   HUGO_ENV = "production"
   HUGO_THEME = "repo"
   HUGO_BASEURL = "https://anatole-demo.netlify.app"

--
Gitblit v1.10.0