Repository navigation
feat: require Hugo v0.158.0 and clear its deprecations - #2322
Merged
Merged
Conversation
Raise module.hugoVersion.min in config/_default/hugo.toml and min_version in theme.toml from v0.153.1 to v0.158.0. Hugo v0.158.0 renamed the languageCode config key to locale and languageName to label, and an older Hugo ignores the new keys, so the floor moves with the rename. The module config, exampleSite and tests/templates now use locale and label. Config never reaches Bookshop's live-editing renderer, so the rename needs no guard. Refs #2314, #2049 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bump mod-utils to v6.18.1 and mod-csp to v1.0.17, which read data and images through guarded APIs, and mod-blocks to v2.15.2 in exampleSite, which reads its structures through GetData. Then migrate hinode's own templates: - site.Languages: the new utilities/GetLanguages.html collects the languages from hugo.Sites, kept to the version and role of the first site so that each language appears once, in site.Languages' order. head.html, navbar-languages, download and sharing use it. - .LanguageName and .LanguageCode: read .Label and .Locale instead. - site.Data: GetDimension and the abbr shortcode read mod-utils' GetData, as do the Markdown variants of the abbr and args shortcodes. - .Site.AllPages: index.redir collects the same pages from hugo.Sites and sorts them by weight, as site.AllPages did. Each partial and shortcode change sits behind a hugo.Version.Compare guard, because Bookshop's live-editing renderer runs Hugo v0.147.6, where the new APIs fail. index.redir has no guard: the renderer never loads it. Add two tests. test:renderer renders the changed partials and the abbr shortcode in Bookshop's renderer (harness copied from mod-utils), with negative controls for unguarded hugo.Sites, .Label and .Locale. Its config keeps languageName, because Hugo v0.147.6 predates label. test:languages builds a multilingual fixture without versions or roles, with versions, with roles, and with English only. It compares the partials, the abbr shortcode and _redirects with the deprecated APIs, and checks that head.html declares the language only when the site has more than one. Its abbr and args pages also render Markdown output, which runs the shortcodes' .md variants. A last build of the fixture leaves the comparisons out and fails on any deprecation it logs. CI runs both tests after test:templates. Refs #2315 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ Deploy Preview for gethinode-demo ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This was referenced Nov 3, 2026
Collaborator
Author
|
🎉 This PR is included in version 3.51.0 🎉 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.
Raises Hinode's minimum Hugo version to v0.158.0 and clears every deprecation listed in #2049. Closes #2314 and #2315.
Commits
feat: require Hugo v0.158.0 or later(Require Hugo v0.158.0 and rename the language config keys #2314)module.hugoVersion.mininconfig/_default/hugo.tomlandmin_versionintheme.toml.languageCode→localeandlanguageName→labelin the module config,exampleSiteandtests/templates.localeandlabel, so the floor moves with the rename.fix: move templates off the APIs Hugo deprecated before v0.158.0(Migrate templates off the APIs deprecated before Hugo v0.158.0 #2315)exampleSite.site.Languages→ newutilities/GetLanguages.html, built onhugo.Sites. Used byhead.html,navbar-languages,downloadandsharing..LanguageName→.Labeland.LanguageCode→.Locale.site.Data→ mod-utilsGetDatainGetDimension,abbr.html,abbr.mdandargs.md..Site.AllPagesinindex.redir→hugo.Sites.test:rendererandtest:languages. CI runs both.The floor commit comes first, so every commit on
mainbuilds on the Hugo version it declares.Live editing
CloudCannon's Live Editor renders partials with Bookshop's embedded Hugo v0.147.6, where
hugo.Sites,hugo.Data,.Labeland.Localefail. Every change in a partial or shortcode therefore sits behind ahugo.Version.Comparecheck that keeps the old call.index.rediris never loaded there, so it switches outright.hugo.Sitesholds one site per language × version × role.GetLanguagesandindex.redirkeep the sites that share the first site's version and role, as mod-utils'GetPagedoes. That reproducessite.Languagesandsite.AllPagesexactly.Verification
exampleSiteoutput is byte-identical tomainon Hugo 0.169.0 (645 files) and on 0.158.0.--logLevel infoit logs no deprecation from Hugo deprecation warnings on v0.164 can't be resolved without raising the v0.146.0 floor #2049's table. Onlyresources.PostProcess(Replace resources.PostProcess with templates.Defer #2319) and Hugo 0.169's INFO.Params.titlenotice remain.test:languagesbuilds a multilingual fixture without versions or roles, with versions, with roles, and with English only.head.htmland_redirectsmust equal the deprecated APIs' results.test:rendererruns the changed partials in Bookshop's real v0.147.6 renderer. Negative controls (unguardedhugo.Sites,.Labeland.Locale) must fail.pnpm testpasses at each commit.pnpm audit --prod --audit-level=highis clean.For consumers
Sites that bump to this release should rename
languageCode→localeandlanguageName→label. The old keys still work and only warn.Rename both levels together. On Hugo 0.158 or later, a top-level
localecombined with a per-languagelanguageCodegives the default content language the top-level value instead of its own (measured on 0.158.0 and 0.166.0:enresolves toen-usinstead ofen-gb). Other languages are unaffected, and any consistent spelling at both levels is fine.🤖 Generated with Claude Code