From 1ffbc19703fb3d3309eb567092a0670eadc4abf4 Mon Sep 17 00:00:00 2001 From: Yibei Chen Date: Wed, 29 Apr 2026 09:30:20 -0400 Subject: [PATCH 1/5] fix: override Hextra RSS template for Hugo 0.160 compatibility Hextra v0.8.3's layouts/_default/list.rss.xml references the legacy .Site.Author hash, which Hugo 0.160+ no longer exposes on the page.Site type. Locally this caused `hugo server` to fail with a template render error on /, /categories, and other section feeds. Netlify (Hugo 0.132.2) was unaffected, so production stayed green. This commit ships a local override of the RSS template that reads site.Params.author instead, plus the corresponding params.author block in hugo.yaml. Co-Authored-By: Claude Opus 4.7 (1M context) --- hugo.yaml | 8 +++++ layouts/_default/list.rss.xml | 61 +++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 layouts/_default/list.rss.xml diff --git a/hugo.yaml b/hugo.yaml index 7a2ec89b..6e2e0df8 100644 --- a/hugo.yaml +++ b/hugo.yaml @@ -49,6 +49,14 @@ menu: type: search params: + # Site author info — read by the local RSS template override at + # layouts/_default/list.rss.xml. Hextra v0.8.3 ships a template that + # references the legacy .Site.Author, which Hugo 0.160+ no longer + # provides; the override reads from site.Params.author instead. + author: + name: ReproNim + email: info@repronim.org + navbar: displayTitle: ReproNim displayLogo: true diff --git a/layouts/_default/list.rss.xml b/layouts/_default/list.rss.xml new file mode 100644 index 00000000..724140d2 --- /dev/null +++ b/layouts/_default/list.rss.xml @@ -0,0 +1,61 @@ +{{- /* + Local override of Hextra v0.8.3's layouts/_default/list.rss.xml. + The upstream template references the legacy .Site.Author hash, which + Hugo 0.160+ no longer exposes on the page.Site type, causing a hard + template error. This override reads the same values from + site.Params.author (set in hugo.yaml). +*/ -}} +{{- $author := site.Params.author -}} + + + {{ site.Title }} – {{ .Title }} + {{ .Permalink }} + Recent content {{ if ne .Title site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ site.Title }} + Hugo -- gohugo.io + {{- with site.LanguageCode }} + {{ . }} + {{- end }} + {{- with $author.email }} + {{ . }}{{ with $author.name }} ({{ . }}){{ end }} + {{ . }}{{ with $author.name }} ({{ . }}){{ end }} + {{- end }} + {{- with site.Copyright }} + {{ . }} + {{- end }} + {{- if not .Date.IsZero }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{- end }} + {{ with .OutputFormats.Get "RSS" -}} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{- end }} + {{ if not $.Section }} + {{ $sections := site.Params.rss.sections | default (slice "blog") }} + {{ .Scratch.Set "rssPages" (first 50 (where site.RegularPages "Type" "in" $sections)) }} + {{ else }} + {{ if $.Parent.IsHome }} + {{ .Scratch.Set "rssPages" (first 50 (where site.RegularPages "Type" $.Section)) }} + {{ else }} + {{ .Scratch.Set "rssPages" (first 50 $.Pages) }} + {{ end }} + {{ end }} + {{ range (.Scratch.Get "rssPages") }} + + {{ .Title }} + {{ .Permalink }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{- with $author.email }} + {{ . }}{{ with $author.name }} ({{ . }}){{ end }} + {{- end }} + {{ .Permalink }} + + {{ $img := (.Resources.ByType "image").GetMatch "*featured*" }} + {{ with $img }} + {{ $img := .Resize "640x" }} + {{ printf "]]>" $img.Permalink $img.Width $img.Height | safeHTML }} + {{ end }} + {{ .Content | html }} + + + {{ end }} + + From 76950b24c99e5e1e25c73f97051108d26cb7ba74 Mon Sep 17 00:00:00 2001 From: Austin Macdonald Date: Tue, 12 May 2026 10:26:12 -0500 Subject: [PATCH 2/5] bump Hextra to v0.12.3 and Hugo to 0.161.1 Hextra v0.12.3 requires Hugo >= 0.146 (new layouts lookup); Hugo 0.156+ also removes the legacy .Site.Author field that the old Hextra RSS template depended on. Bump both pins so the site builds on a Hugo version that matches the local dev environment. Co-Authored-By: Claude Opus 4.7 (1M context) --- go.mod | 2 +- go.sum | 4 ++-- netlify.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 5eb30c62..b2803c47 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module github.com/imfing/hextra-starter-template go 1.21 -require github.com/imfing/hextra v0.8.3 // indirect +require github.com/imfing/hextra v0.12.3 // indirect diff --git a/go.sum b/go.sum index 60e6bd22..afa86809 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,2 @@ -github.com/imfing/hextra v0.8.3 h1:peKCtkOwcVMQV2EqMb/VUhwpYDsI1B14U1rDqAgMHzk= -github.com/imfing/hextra v0.8.3/go.mod h1:cEfel3lU/bSx7lTE/+uuR4GJaphyOyiwNR3PTqFTXpI= +github.com/imfing/hextra v0.12.3 h1:DZHY2rUWYteyzjlHi9r4n7Bb5e2Q+6LXe4C1Dqn0ZjM= +github.com/imfing/hextra v0.12.3/go.mod h1:vi+yhpq8YPp/aghvJlNKVnJKcPJ/VyAEcfC1BSV9ARo= diff --git a/netlify.toml b/netlify.toml index 5b9df24b..0c721b6d 100644 --- a/netlify.toml +++ b/netlify.toml @@ -3,7 +3,7 @@ publish = "public" command = "hugo --gc --minify -b ${DEPLOY_PRIME_URL}" [build.environment] -HUGO_VERSION = "0.132.2" +HUGO_VERSION = "0.161.1" DEPLOY_PRIME_URL = "https://repronim.org" From 783f503fea5de25a044c1bf45b6dfcbaf9d0a247 Mon Sep 17 00:00:00 2001 From: Austin Macdonald Date: Tue, 12 May 2026 10:27:41 -0500 Subject: [PATCH 3/5] drop local RSS template override Co-Authored-By: Claude Opus 4.7 (1M context) --- hugo.yaml | 5 +-- layouts/_default/list.rss.xml | 61 ----------------------------------- 2 files changed, 1 insertion(+), 65 deletions(-) delete mode 100644 layouts/_default/list.rss.xml diff --git a/hugo.yaml b/hugo.yaml index 6e2e0df8..472ffcd2 100644 --- a/hugo.yaml +++ b/hugo.yaml @@ -49,10 +49,7 @@ menu: type: search params: - # Site author info — read by the local RSS template override at - # layouts/_default/list.rss.xml. Hextra v0.8.3 ships a template that - # references the legacy .Site.Author, which Hugo 0.160+ no longer - # provides; the override reads from site.Params.author instead. + # Populates RSS managingEditor/webMaster (read by Hextra's RSS template). author: name: ReproNim email: info@repronim.org diff --git a/layouts/_default/list.rss.xml b/layouts/_default/list.rss.xml deleted file mode 100644 index 724140d2..00000000 --- a/layouts/_default/list.rss.xml +++ /dev/null @@ -1,61 +0,0 @@ -{{- /* - Local override of Hextra v0.8.3's layouts/_default/list.rss.xml. - The upstream template references the legacy .Site.Author hash, which - Hugo 0.160+ no longer exposes on the page.Site type, causing a hard - template error. This override reads the same values from - site.Params.author (set in hugo.yaml). -*/ -}} -{{- $author := site.Params.author -}} - - - {{ site.Title }} – {{ .Title }} - {{ .Permalink }} - Recent content {{ if ne .Title site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ site.Title }} - Hugo -- gohugo.io - {{- with site.LanguageCode }} - {{ . }} - {{- end }} - {{- with $author.email }} - {{ . }}{{ with $author.name }} ({{ . }}){{ end }} - {{ . }}{{ with $author.name }} ({{ . }}){{ end }} - {{- end }} - {{- with site.Copyright }} - {{ . }} - {{- end }} - {{- if not .Date.IsZero }} - {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} - {{- end }} - {{ with .OutputFormats.Get "RSS" -}} - {{ printf "" .Permalink .MediaType | safeHTML }} - {{- end }} - {{ if not $.Section }} - {{ $sections := site.Params.rss.sections | default (slice "blog") }} - {{ .Scratch.Set "rssPages" (first 50 (where site.RegularPages "Type" "in" $sections)) }} - {{ else }} - {{ if $.Parent.IsHome }} - {{ .Scratch.Set "rssPages" (first 50 (where site.RegularPages "Type" $.Section)) }} - {{ else }} - {{ .Scratch.Set "rssPages" (first 50 $.Pages) }} - {{ end }} - {{ end }} - {{ range (.Scratch.Get "rssPages") }} - - {{ .Title }} - {{ .Permalink }} - {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} - {{- with $author.email }} - {{ . }}{{ with $author.name }} ({{ . }}){{ end }} - {{- end }} - {{ .Permalink }} - - {{ $img := (.Resources.ByType "image").GetMatch "*featured*" }} - {{ with $img }} - {{ $img := .Resize "640x" }} - {{ printf "]]>" $img.Permalink $img.Width $img.Height | safeHTML }} - {{ end }} - {{ .Content | html }} - - - {{ end }} - - From 686398d926f7ed9f5abc83a9cb0457a406ea5785 Mon Sep 17 00:00:00 2001 From: Austin Macdonald Date: Tue, 12 May 2026 10:36:05 -0500 Subject: [PATCH 4/5] drop unused .devcontainer/ scaffold Vestigial from the Hextra starter-template clone. No one on the team uses devcontainers; deleting saves a stale config that would otherwise need bumping on every Hugo/Hextra upgrade. Co-Authored-By: Claude Opus 4.7 (1M context) --- .devcontainer/devcontainer.json | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index f25098bd..00000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "image": "mcr.microsoft.com/devcontainers/go:1", - "features": { - "ghcr.io/devcontainers/features/hugo:1": { - "extended": true, - "version": "0.132.2" - }, - "ghcr.io/devcontainers/features/node:1": {} - }, - "customizations": { - "vscode": { - "extensions": [ - "mhutchie.git-graph", - "esbenp.prettier-vscode", - "tamasfe.even-better-toml", - "budparr.language-hugo-vscode" - ] - } - }, - "forwardPorts": [1313] -} From 84f34801a19e98d6f962cb4af848735f07f187d6 Mon Sep 17 00:00:00 2001 From: Austin Macdonald Date: Tue, 12 May 2026 10:39:42 -0500 Subject: [PATCH 5/5] migrate site.Data shortcodes to hugo.Data site.Data was deprecated in Hugo 0.156.0 in favor of hugo.Data and will be removed in a future release. Switches both custom shortcodes (people, fellows-resources). Sets the effective minimum Hugo for this site to 0.156. Co-Authored-By: Claude Opus 4.7 (1M context) --- layouts/shortcodes/fellows-resources.html | 2 +- layouts/shortcodes/people.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/shortcodes/fellows-resources.html b/layouts/shortcodes/fellows-resources.html index 9227ebfd..0255c5be 100644 --- a/layouts/shortcodes/fellows-resources.html +++ b/layouts/shortcodes/fellows-resources.html @@ -1,4 +1,4 @@ -{{ $resources := site.Data.fellowsresources.resources }} +{{ $resources := hugo.Data.fellowsresources.resources }}
{{ range $resources }} diff --git a/layouts/shortcodes/people.html b/layouts/shortcodes/people.html index d037279e..2740655e 100644 --- a/layouts/shortcodes/people.html +++ b/layouts/shortcodes/people.html @@ -1,5 +1,5 @@ {{ $listParam := .Get 0 }} -{{ $people := index .Site.Data $listParam }} +{{ $people := index hugo.Data $listParam }}