feat(hugo): replace deprecated APIs for Hugo v0.156+ compatibility

Migrate site.Data → hugo.Data (42 occurrences), site.IsMultiLingual →
hugo.IsMultilingual, and site.AllPages → hugo.Sites nested range.
Simplify Netlify redirects template to use pre-processed aliases
instead of relLangURL per gohugoio/hugo#14408.
This commit is contained in:
George Cushen committed 2026-03-27 03:25:42 +00:00
1 parent 94703c5c4f
commit ef8ed449c7
25 files changed
+5824 -5838

No files matched your search

@@ -5,9 +5,9 @@
{{- partial "functions/get_icon" (dict "name" "globe-alt" "attributes" `class="inline-block pr-1" style="height: 1em"`) -}}
{{ i18n "languages" }}:
</div>
<div class="font-bold">{{ index site.Data.languages .Lang }}</div>
<div class="font-bold">{{ index hugo.Data.languages .Lang }}</div>
{{ range .Translations }}
<div><a href="{{ .Permalink }}">{{ index site.Data.languages .Lang }}</a></div>
<div><a href="{{ .Permalink }}">{{ index hugo.Data.languages .Lang }}</a></div>
{{ end }}
</div>
{{ end }}
@@ -104,7 +104,7 @@
<li class="lg:px-2">
<select onchange="document.documentElement.setAttribute('data-theme-pack', this.value); localStorage.setItem('hb-theme-pack', this.value);" class="bg-transparent text-[var(--hb-color-header-fg)] border-none focus:ring-0 cursor-pointer text-sm font-medium">
<option value="">Theme</option>
{{ range $name, $data := site.Data.themes }}
{{ range $name, $data := hugo.Data.themes }}
<option value="{{ $name }}">{{ $name | humanize }}</option>
{{ end }}
</select>
@@ -181,7 +181,7 @@
<div class="px-3">
<select onchange="document.documentElement.setAttribute('data-theme-pack', this.value); localStorage.setItem('hb-theme-pack', this.value);" class="bg-transparent text-[var(--hb-color-header-fg)] border-none focus:ring-0 cursor-pointer text-sm font-medium">
<option value="">Theme</option>
{{ range $name, $data := site.Data.themes }}
{{ range $name, $data := hugo.Data.themes }}
<option value="{{ $name }}">{{ $name | humanize }}</option>
{{ end }}
</select>
@@ -16,7 +16,7 @@
<div class="flex items-center gap-2 capitalize">
{{/* Match theme chooser icon height */}}
{{- partial "functions/get_icon" (dict "name" "globe-alt" "attributes" "height=18") -}}
{{- if not $hide_language_name -}}<span>{{ index site.Data.languages $page.Lang }}</span>{{ end -}}
{{- if not $hide_language_name -}}<span>{{ index hugo.Data.languages $page.Lang }}</span>{{ end -}}
</div>
</button>
<ul
@@ -29,7 +29,7 @@
href="{{ .Permalink }}"
class="relative cursor-pointer text-gray-800 dark:text-gray-100 hover:bg-primary-50 hover:text-primary-600 hover:dark:bg-primary-500/10 hover:dark:text-primary-200 whitespace-nowrap py-1.5 transition-colors ltr:pl-3 ltr:pr-9 rtl:pr-3 rtl:pl-9"
>
{{- index site.Data.languages .Lang -}}
{{- index hugo.Data.languages .Lang -}}
</a>
</li>
{{ end -}}
@@ -1,6 +1,6 @@
{{ if ne .Params.share false }}
<section class="flex flex-row flex-wrap justify-center pt-4 text-xl">
{{ range where site.Data.page_sharer.links "enable" true }}
{{ range where hugo.Data.page_sharer.links "enable" true }}
{{/* mailto URIs require percent-encoding (%20 for spaces) per RFC 6068, not form-encoding (+ for spaces). */}}
{{/* Use urls.PathEscape for mailto; urlquery for other schemes (https, etc.). */}}