From 53059c2db7f0b2cb5b4050afc04445f39ab4d5f2 Mon Sep 17 00:00:00 2001 From: Thanwer Date: Sat, 23 May 2026 18:30:15 +0200 Subject: [PATCH] Update custom layouts for Hugo 0.123+ and bump Hugo to 0.151.0 site.Language.Locale and .Language.Label were removed from Hugo's template API in 0.123 / 0.124. The theme already uses the new names; only our overrides in layouts/ still referenced the old ones. - layouts/_default/baseof.html: site.Language.Locale -> site.LanguageCode - layouts/_default/sitemap.xml: .Language.Label -> .Language.LanguageCode (hreflang expects a BCP47 code, not a display name) - layouts/partials/language-switcher.html: .Language.Label -> .Language.LanguageName (display name for the switcher UI) Co-Authored-By: Claude Opus 4.7 --- .gitea/workflows/deploy.yml | 2 +- layouts/_default/baseof.html | 2 +- layouts/_default/sitemap.xml | 4 ++-- layouts/partials/language-switcher.html | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index aafd30f..645e765 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -6,7 +6,7 @@ on: workflow_dispatch: env: - HUGO_VERSION: "0.121.2" + HUGO_VERSION: "0.151.0" jobs: deploy: diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 03a54cb..02eb354 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -8,7 +8,7 @@ {{ $dataTheme = $params.colorTheme }} {{ end }} - + {{ block "head" . }} {{ partial "head/head.html" . }} diff --git a/layouts/_default/sitemap.xml b/layouts/_default/sitemap.xml index bda75eb..596ab73 100644 --- a/layouts/_default/sitemap.xml +++ b/layouts/_default/sitemap.xml @@ -10,12 +10,12 @@ {{ .Sitemap.Priority }}{{ end }}{{ if .IsTranslated }}{{ range .Translations }} {{ end }} {{ end }} diff --git a/layouts/partials/language-switcher.html b/layouts/partials/language-switcher.html index f67cc3b..4770e02 100644 --- a/layouts/partials/language-switcher.html +++ b/layouts/partials/language-switcher.html @@ -7,9 +7,9 @@ {{ range $translations }} {{ if eq .Lang $pageLang }} -
  • {{ .Language.Label }}
  • +
  • {{ .Language.LanguageName }}
  • {{ else }} -
  • {{ .Language.Label }}
  • +
  • {{ .Language.LanguageName }}
  • {{ end }} {{ end }}