mirror of https://github.com/lxndrblz/anatole.git

Markus Bilz
3 days ago 7e2dfa693bb7b3cc2a834db3ce26b82d850b1c59
chore: fix hugo deprecation warnings (hugo 0.158.0) (#589)

- Bump Hugo version to 0.158.0 in CI and Netlify
- Replace deprecated `languageCode` with `locale` in config
- Replace deprecated `LanguageDirection` with `Direction` in config and templates
- Replace deprecated `.Site.LanguageCode` with `.Site.Language.Locale` in rss.xml and schema.html

---------

Co-authored-by: Alexander Bilz <mail@alexbilz.com>
8 files modified
18 ■■■■ changed files
.github/workflows/update-resources.yml 2 ●●● patch | view | raw | blame | history
exampleSite/config/_default/hugo.toml 2 ●●● patch | view | raw | blame | history
exampleSite/config/_default/languages.toml 2 ●●● patch | view | raw | blame | history
layouts/_default/baseof.html 2 ●●● patch | view | raw | blame | history
layouts/_default/rss.xml 2 ●●● patch | view | raw | blame | history
layouts/partials/head.html 4 ●●●● patch | view | raw | blame | history
layouts/partials/schema.html 2 ●●● patch | view | raw | blame | history
netlify.toml 2 ●●● patch | view | raw | blame | history
.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:
exampleSite/config/_default/hugo.toml
@@ -1,5 +1,5 @@
baseURL = "https://example.com"
languageCode = "en"
locale = "en"
DefaultContentLanguage = "en"
title = "Website of Jane Doe"
exampleSite/config/_default/languages.toml
@@ -8,7 +8,7 @@
title = "فلانة الفلانية"
contentDir = "content/arabic"
weight = 2
LanguageDirection = "rtl"
Direction = "rtl"
LanguageName = "AR"
[ar.params]
description = "أنا أعمل كمطورة ويب في شركة س"
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" }}
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 }}
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 -}}
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",
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"