fix: keep the RSS <language> element working on Hugo < 0.158#2054
Merged
Conversation
site.Language.Locale was added in Hugo 0.158 (languageCode was deprecated in its favour). On Hugo 0.146-0.157 the RSS template errored with "can't evaluate field Locale in type *langs.Language", failing every RSS render. Version-gate it: site.Language.Locale on Hugo >= 0.158, site.Language.LanguageCode on older Hugo. Verified: exampleSite RSS renders with no error on Hugo 0.147.6 and 0.164.0.
✅ Deploy Preview for gethinode-demo ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Collaborator
Author
|
🎉 This PR is included in version 3.6.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
site.Language.Localewas added in Hugo 0.158 (whenlanguageCodewas deprecated in itsfavour).
layouts/rss.xmluses it unconditionally, so on Hugo 0.146–0.157 every RSS renderfails with:
Version-gate it:
site.Language.Localeon Hugo ≥ 0.158,site.Language.LanguageCodeon olderHugo.
hugo.Version.Compare "0.158.0"is a semantic (not string) version test.Why
Restores the theme's stated Hugo compatibility floor. Found while validating Hugo 0.147.6
support for the starter template.
Evidence
<language>=en-uson 0.164, the language code on 0.147.6.
Held for review. (Separately: the search-index
templates.Deferleak on Hugo < 0.164 isfixed in gethinode/mod-flexsearch#310; the two together restore hinode-v3.6.0 rendering on Hugo
0.147.6+. A postcss-transform failure seen locally on 0.147.6 traces to a broken pnpm
.bin/postcssshim on the dev machine — not a theme defect.)