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>
| | |
| | | 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: |
| | |
| | | baseURL = "https://example.com" |
| | | languageCode = "en" |
| | | locale = "en" |
| | | DefaultContentLanguage = "en" |
| | | title = "Website of Jane Doe" |
| | | |
| | |
| | | title = "فلانة الفلانية" |
| | | contentDir = "content/arabic" |
| | | weight = 2 |
| | | LanguageDirection = "rtl" |
| | | Direction = "rtl" |
| | | LanguageName = "AR" |
| | | [ar.params] |
| | | description = "أنا أعمل كمطورة ويب في شركة س" |
| | |
| | | <!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" }} |
| | |
| | | <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 }} |
| | |
| | | |
| | | <!-- 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)) |
| | |
| | | {{ $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 -}} |
| | |
| | | {{ $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", |
| | |
| | | """ |
| | | |
| | | [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" |