From 7e2dfa693bb7b3cc2a834db3ce26b82d850b1c59 Mon Sep 17 00:00:00 2001
From: Markus Bilz <github@markusbilz.com>
Date: Sun, 12 Jul 2026 11:56:10 +0000
Subject: [PATCH] chore: fix hugo deprecation warnings (hugo 0.158.0) (#589)

---
 layouts/_default/rss.xml                   |    2 +-
 exampleSite/config/_default/hugo.toml      |    2 +-
 layouts/_default/baseof.html               |    2 +-
 layouts/partials/schema.html               |    2 +-
 .github/workflows/update-resources.yml     |    2 +-
 layouts/partials/head.html                 |    4 ++--
 exampleSite/config/_default/languages.toml |    2 +-
 netlify.toml                               |    2 +-
 8 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/.github/workflows/update-resources.yml b/.github/workflows/update-resources.yml
index c7f9282..10f3349 100644
--- a/.github/workflows/update-resources.yml
+++ b/.github/workflows/update-resources.yml
@@ -17,7 +17,7 @@
         uses: peaceiris/actions-hugo@v3
         with:
           extended: true
-          hugo-version: 0.157.0
+          hugo-version: 0.158.0
       - name: setup node
         uses: actions/setup-node@v6
         with:
diff --git a/exampleSite/config/_default/hugo.toml b/exampleSite/config/_default/hugo.toml
index e877d4a..4dd1077 100644
--- a/exampleSite/config/_default/hugo.toml
+++ b/exampleSite/config/_default/hugo.toml
@@ -1,5 +1,5 @@
 baseURL = "https://example.com"
-languageCode = "en"
+locale = "en"
 DefaultContentLanguage = "en"
 title = "Website of Jane Doe"
 
diff --git a/exampleSite/config/_default/languages.toml b/exampleSite/config/_default/languages.toml
index 8069db7..346d785 100644
--- a/exampleSite/config/_default/languages.toml
+++ b/exampleSite/config/_default/languages.toml
@@ -8,7 +8,7 @@
 title = "فلانة الفلانية"
 contentDir = "content/arabic"
 weight = 2
-LanguageDirection = "rtl"
+Direction = "rtl"
 LanguageName = "AR"
 [ar.params]
 description = "أنا أعمل كمطورة ويب في شركة س"
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index fcc64e6..5f1071d 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -1,6 +1,6 @@
 <!doctype html>
 <html
-  dir="{{ .Site.Language.LanguageDirection | default "ltr" }}"
+  dir="{{ .Site.Language.Direction | default "ltr" }}"
   lang="{{- site.Language.Lang -}}"
   data-theme="{{- .Site.Params.displayMode -}}"
   {{ if eq .Site.Params.displayMode "dark" }}
diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml
index 45c5ee8..1826550 100644
--- a/layouts/_default/rss.xml
+++ b/layouts/_default/rss.xml
@@ -34,7 +34,7 @@
     <title>{{ if eq  .Title  .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
     <link>{{ .Permalink }}</link>
     <description>Recent content {{ if ne  .Title  .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
-    <generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
+    <generator>Hugo -- gohugo.io</generator>{{ with .Site.Language.Locale }}
     <language>{{.}}</language>{{end}}{{ with $authorEmail }}
     <managingEditor>{{.}}{{ with $authorName }} ({{.}}){{end}}</managingEditor>{{end}}{{ with $authorEmail }}
     <webMaster>{{.}}{{ with $authorName }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index c9e508f..f8859da 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -48,7 +48,7 @@
 
   <!-- CSS -->
   {{ $contentRatio := or site.Params.contentratio 0.6 -}}
-  {{ $languageDirection := or site.Language.LanguageDirection "ltr" -}}
+  {{ $languageDirection := or site.Language.Direction "ltr" -}}
   {{ $vars := dict
     "text_direction" $languageDirection
     "content_ratio" (printf "%f%%" (mul $contentRatio 100))
@@ -59,7 +59,7 @@
   {{ $options := dict
     "transpiler" "dartsass"
     "vars" $vars
-    "targetPath" (printf "css/anatole%s.css" (cond (eq site.Language.LanguageDirection "") "" (printf ".%s" site.Language.LanguageDirection)))
+    "targetPath" (printf "css/anatole%s.css" (cond (eq site.Language.Direction "") "" (printf ".%s" site.Language.Direction)))
   -}}
   {{ with resources.Get "scss/main.scss" -}}
     {{ if hugo.IsProduction -}}
diff --git a/layouts/partials/schema.html b/layouts/partials/schema.html
index 52c3338..aafc672 100644
--- a/layouts/partials/schema.html
+++ b/layouts/partials/schema.html
@@ -52,7 +52,7 @@
           {{ $copyright := replace . "{{ YEAR }}" (now.Format "2006") }}
           "copyrightYear": "{{ index (findRE `^\d{4}` $copyright 1) 0 }}",
         {{ end }}
-        "inLanguage": {{ .Site.LanguageCode | default "en-us" }},
+        "inLanguage": {{ (.Site.Language.Locale | default "en-us") | jsonify }},
         "isFamilyFriendly": "true",
         "mainEntityOfPage": {
             "@type": "WebPage",
diff --git a/netlify.toml b/netlify.toml
index ce0a894..b526665 100644
--- a/netlify.toml
+++ b/netlify.toml
@@ -10,7 +10,7 @@
   """
 
 [build.environment]
-  HUGO_VERSION = "0.157.0"
+  HUGO_VERSION = "0.158.0"
   DART_SASS_VERSION = "1.97.3"
   NODE_VERSION = "24"
   GO_VERSION = "1.26.0"

--
Gitblit v1.10.0