Merge pull request #2887 from EricGusmao/fix/hugo-v0.156.0-deprecations

Fix Hugo v0.156.0 template deprecations
This commit is contained in:
Nuno C.
2026-04-06 11:24:37 +01:00
committed by GitHub
11 changed files with 16 additions and 12 deletions
+1 -1
View File
@@ -97,7 +97,7 @@
{{ end }} {{ end }}
{{ define "SingleAuthor" }} {{ define "SingleAuthor" }}
{{ $authorsData := site.Data.authors }} {{ $authorsData := hugo.Data.authors }}
{{ $taxonomies := site.Taxonomies.authors }} {{ $taxonomies := site.Taxonomies.authors }}
{{ $baseURL := site.BaseURL }} {{ $baseURL := site.BaseURL }}
{{ $taxonomyLink := 0 }} {{ $taxonomyLink := 0 }}
+1 -1
View File
@@ -1,4 +1,4 @@
{{ with site.Data.contributors }} {{ with hugo.Data.contributors }}
<section class="contributors-section mt-12 mb-16"> <section class="contributors-section mt-12 mb-16">
<div class="flex flex-col items-center mb-6"> <div class="flex flex-col items-center mb-6">
<div class="flex items-center gap-2 mb-2"> <div class="flex items-center gap-2 mb-2">
+1 -1
View File
@@ -1,5 +1,5 @@
{{ with .Params.sharingLinks | default (.Site.Params.article.sharingLinks | default false) }} {{ with .Params.sharingLinks | default (.Site.Params.article.sharingLinks | default false) }}
{{ $links := site.Data.sharing }} {{ $links := hugo.Data.sharing }}
<section class="flex flex-row flex-wrap justify-center pt-4 text-xl"> <section class="flex flex-row flex-wrap justify-center pt-4 text-xl">
{{ range . }} {{ range . }}
{{ with index $links . }} {{ with index $links . }}
+1 -1
View File
@@ -1,4 +1,4 @@
{{ with site.Data.sponsors }} {{ with hugo.Data.sponsors }}
<section class="sponsors-section mt-16 mb-8"> <section class="sponsors-section mt-16 mb-8">
<div class="flex flex-col items-center mb-6"> <div class="flex flex-col items-center mb-6">
<div class="flex items-center gap-2 mb-2"> <div class="flex items-center gap-2 mb-2">
+1 -1
View File
@@ -124,7 +124,7 @@
{{ end }} {{ end }}
{{ if $hasRepoCards }} {{ if $hasRepoCards }}
{{ $repoColors := site.Data.repoColors }} {{ $repoColors := hugo.Data.repoColors }}
{{ $cssRules := slice }} {{ $cssRules := slice }}
{{/* default color */}} {{/* default color */}}
+5 -1
View File
@@ -3,7 +3,11 @@
{{ $compactSummary := .Get "compactSummary" | default false }} {{ $compactSummary := .Get "compactSummary" | default false }}
{{ $target := .Page }} {{ $target := .Page }}
{{ if ne $link .Page.RelPermalink }} {{ if ne $link .Page.RelPermalink }}
{{ $target = index (first 1 (where .Site.AllPages "RelPermalink" $link)) 0 }} {{ $pages := slice }}
{{ range hugo.Sites }}
{{ $pages = $pages | append .Pages }}
{{ end }}
{{ $target = index (first 1 (where $pages "RelPermalink" $link)) 0 }}
{{ end }} {{ end }}
{{ if $target }} {{ if $target }}
<section class="space-y-10 w-full"> <section class="space-y-10 w-full">
+1 -1
View File
@@ -1,6 +1,6 @@
{{ $id := delimit (slice "codeberg" (partial "functions/uid.html" .)) "-" }} {{ $id := delimit (slice "codeberg" (partial "functions/uid.html" .)) "-" }}
{{- $codebergURL := print "https://codeberg.org/api/v1/repos/" (.Get "repo") -}} {{- $codebergURL := print "https://codeberg.org/api/v1/repos/" (.Get "repo") -}}
{{- $repoColors := .Site.Data.repoColors -}} {{- $repoColors := hugo.Data.repoColors -}}
{{- $codebergData := dict -}} {{- $codebergData := dict -}}
{{- with try (resources.GetRemote $codebergURL) -}} {{- with try (resources.GetRemote $codebergURL) -}}
{{- with .Err -}} {{- with .Err -}}
+1 -1
View File
@@ -1,6 +1,6 @@
{{ $id := delimit (slice "forgejo" (partial "functions/uid.html" .)) "-" }} {{ $id := delimit (slice "forgejo" (partial "functions/uid.html" .)) "-" }}
{{- $forgejoURL := print (.Get "server" | default .Site.Params.forgejoDefaultServer) "/api/v1/repos/" (.Get "repo") -}} {{- $forgejoURL := print (.Get "server" | default .Site.Params.forgejoDefaultServer) "/api/v1/repos/" (.Get "repo") -}}
{{- $repoColors := .Site.Data.repoColors -}} {{- $repoColors := hugo.Data.repoColors -}}
{{- $forgejoData := dict -}} {{- $forgejoData := dict -}}
{{- with try (resources.GetRemote $forgejoURL) -}} {{- with try (resources.GetRemote $forgejoURL) -}}
{{- with .Err -}} {{- with .Err -}}
+1 -1
View File
@@ -1,6 +1,6 @@
{{ $id := delimit (slice "gitea" (partial "functions/uid.html" .)) "-" }} {{ $id := delimit (slice "gitea" (partial "functions/uid.html" .)) "-" }}
{{- $giteaURL := print (.Get "server" | default .Site.Params.giteaDefaultServer) "/api/v1/repos/" (.Get "repo") -}} {{- $giteaURL := print (.Get "server" | default .Site.Params.giteaDefaultServer) "/api/v1/repos/" (.Get "repo") -}}
{{- $repoColors := .Site.Data.repoColors -}} {{- $repoColors := hugo.Data.repoColors -}}
{{- $giteaData := dict -}} {{- $giteaData := dict -}}
{{- with try (resources.GetRemote $giteaURL) -}} {{- with try (resources.GetRemote $giteaURL) -}}
{{- with .Err -}} {{- with .Err -}}
+1 -1
View File
@@ -2,7 +2,7 @@
{{- $githubURL := print "https://api.github.com/repos/" (.Get "repo") -}} {{- $githubURL := print "https://api.github.com/repos/" (.Get "repo") -}}
{{- $githubThumbnailURL := print "https://opengraph.githubassets.com/0/" (.Get "repo") -}} {{- $githubThumbnailURL := print "https://opengraph.githubassets.com/0/" (.Get "repo") -}}
{{- $showThumbnail := .Get "showThumbnail" | default true -}} {{- $showThumbnail := .Get "showThumbnail" | default true -}}
{{- $repoColors := .Site.Data.repoColors -}} {{- $repoColors := hugo.Data.repoColors -}}
{{- $githubData := dict -}} {{- $githubData := dict -}}
{{- with try (resources.GetRemote $githubURL) -}} {{- with try (resources.GetRemote $githubURL) -}}
{{- with .Err -}} {{- with .Err -}}
+2 -2
View File
@@ -3,6 +3,6 @@
publish = "exampleSite/public" publish = "exampleSite/public"
[build.environment] [build.environment]
HUGO_VERSION = "0.155.3" HUGO_VERSION = "0.159.1"
HUGO_THEMESDIR = "../.." HUGO_THEMESDIR = "../.."
HUGO_THEME = "repo" HUGO_THEME = "repo"