POC: Upgrade Hugo to 0.164.0#107
Conversation
Replace template constructs removed since 0.119 (getJSON, .Site.IsServer, .Site.GoogleAnalytics/.Site.DisqusShortname, nil-File comparison), shadow Docsy 0.7.1's swagger/list.html whose parse-error typo Hugo >= 0.146 rejects, and allow Node fs reads for the PostCSS sandbox introduced in 0.161 (browserslist probes ancestor directories). Pin 0.164.0 in netlify.toml and hugo-extended, refresh caniuse-lite, and fix deprecated config/front-matter keys (taxonomyTerm, languageName, cascade._target). Templates stay compatible with Hugo >= 0.120 for module consumers; module.hugoVersion.min and theme min_version bumped accordingly. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/_index.md`:
- Around line 8-16: The cascade YAML in docs/_index.md lines 8-16 has misplaced
list markers: move each “-” from type: to the corresponding target: entry and
indent path: beneath target:, with type: and toc_root: as siblings. Verify
docs/pages/docs-homepage.md line 12 similarly and make the same structural
correction if it uses list-style cascade entries.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 01c19967-ce83-45bc-9fbd-0baf0ec82995
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (14)
config.tomldocs/_index.mddocs/pages/docs-homepage.mdlayouts/_default/content.htmllayouts/api-reference/content.htmllayouts/docs/list.htmllayouts/home.htmllayouts/partials/footer.htmllayouts/partials/head-css.htmllayouts/partials/section-index.htmllayouts/swagger/list.htmlnetlify.tomlpackage.jsontheme.toml
| target: | ||
| path: "/*" | ||
| - type: "docs" | ||
| toc_root: true | ||
| _target: | ||
| target: | ||
| path: "/*/**" | ||
| - type: "docs" | ||
| toc_root: true | ||
| _target: | ||
| target: |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🔴 Critical | ⚡ Quick win
YAML list marker misplacement during _target → target migration. The front-matter cascade migration from Hugo's deprecated _target key to target may have orphaned the YAML - list marker onto type: instead of target:, producing invalid YAML. Both files need the - on the target: line.
docs/_index.md#L8-L16: Move-fromtype:(lines 10, 14) totarget:(lines 8, 12) and adjust indentation sopath:nests undertarget:andtype:/toc_root:are siblings within each list item.docs/pages/docs-homepage.md#L12-L12: Verify the full cascade YAML structure — if it uses list-style cascade entries, ensure-is ontarget:, nottype:.
📍 Affects 2 files
docs/_index.md#L8-L16(this comment)docs/pages/docs-homepage.md#L12-L12
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/_index.md` around lines 8 - 16, The cascade YAML in docs/_index.md lines
8-16 has misplaced list markers: move each “-” from type: to the corresponding
target: entry and indent path: beneath target:, with type: and toc_root: as
siblings. Verify docs/pages/docs-homepage.md line 12 similarly and make the same
structural correction if it uses list-style cascade entries.
Summary
Proof-of-concept upgrade from Hugo 0.119/0.115 to 0.164.0 (latest). The theme builds cleanly and the rendered output was diffed file-by-file against a 0.119 baseline — no functional differences (details below).
Template fixes (compatible with Hugo >= 0.120 for module consumers)
footer.html:getJSON(removed) →resources.GetRemote+transform.Unmarshal; a failed fetch still fails the build, matching the old semanticshead-css.html:.Site.IsServer(removed) →hugo.IsServersection-index.html: nil-Filehard error fixed by comparingParent.Pathinstead ofParent.File.UniqueIDhome.html,docs/list.html,_default/content.html,api-reference/content.html:.Site.GoogleAnalytics/.Site.DisqusShortname(removed) →.Site.Config.Services.*layouts/swagger/list.html: shadows Docsy 0.7.1's copy, which contains a parse-error typo (.-) that Hugo >= 0.146 rejects during eager template parsing; drop when Docsy is upgradedConfig & toolchain
netlify.toml: pinHUGO_VERSION = "0.164.0"(check the Netlify UI for a conflicting env var)package.json:hugo-extended ^0.164.0(drivesnpm run build/startand the a11y audit), explicitbrowserslist,caniuse-literefreshedconfig.toml:security.node.permissions.allowRead = ["*"]— Hugo >= 0.161 sandboxes PostCSS's Node process and browserslist probes every ancestor directory, so reads must stay unrestricted (write/child-process restrictions keep their defaults); deprecatedtaxonomyTermkind,languageName→label,module.hugoVersion.min→ 0.120.0 (same intheme.toml)docs/*: cascade_target→targetOutput verification (0.119 vs 0.164)
All 113 output files present in both builds; 75 byte-identical. The 38 diffs decompose into: modernized internal OpenGraph/Twitter meta templates, cosmetic case normalization (
currentColor, hex colors), newer Chroma code-fence token colors, whitespace, updated-minifier equivalences (void 0→0[0],transparent→initial), and autoprefixer dropping prefixes obsolete per refreshed caniuse data. Two upstream bug fixes: the old CSS minifier corrupted Bootstrap's.btn-closebackground shorthand and.modal-header .btn-closepadding — both now emit correctly.One behavior note: Hugo's internal alias-redirect stubs no longer include
<meta name="robots" content="noindex">(canonical link + 0s meta refresh remain). A smalllayouts/alias.htmloverride can restore it if desired.Coordination before merging for real
hugo mod get -u.Site.Data→hugo.Data(needs consumers on >= 0.156), Docsy 0.7.1 → 0.15 (separate project)🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Compatibility