Skip to content

POC: Upgrade Hugo to 0.164.0#107

Draft
czechian wants to merge 1 commit into
masterfrom
poc/hugo-0.164-upgrade
Draft

POC: Upgrade Hugo to 0.164.0#107
czechian wants to merge 1 commit into
masterfrom
poc/hugo-0.164-upgrade

Conversation

@czechian

@czechian czechian commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

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 semantics
  • head-css.html: .Site.IsServer (removed) → hugo.IsServer
  • section-index.html: nil-File hard error fixed by comparing Parent.Path instead of Parent.File.UniqueID
  • home.html, docs/list.html, _default/content.html, api-reference/content.html: .Site.GoogleAnalytics / .Site.DisqusShortname (removed) → .Site.Config.Services.*
  • New 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 upgraded

Config & toolchain

  • netlify.toml: pin HUGO_VERSION = "0.164.0" (check the Netlify UI for a conflicting env var)
  • package.json: hugo-extended ^0.164.0 (drives npm run build/start and the a11y audit), explicit browserslist, caniuse-lite refreshed
  • config.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); deprecated taxonomyTerm kind, languageNamelabel, module.hugoVersion.min → 0.120.0 (same in theme.toml)
  • docs/*: cascade _targettarget

Output 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 00[0], transparentinitial), and autoprefixer dropping prefixes obsolete per refreshed caniuse data. Two upstream bug fixes: the old CSS minifier corrupted Bootstrap's .btn-close background shorthand and .modal-header .btn-close padding — 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 small layouts/alias.html override can restore it if desired.

Coordination before merging for real

  • Consumer doc sites import this theme as a Hugo module and need Hugo >= 0.120 (0.164 recommended) on their next hugo mod get -u
  • Follow-ups deferred on purpose: .Site.Datahugo.Data (needs consumers on >= 0.156), Docsy 0.7.1 → 0.15 (separate project)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added dedicated rendering support for Swagger documentation pages, including titles, descriptions, reading time, feedback, comments, and modification details.
    • Improved documentation navigation by ensuring subpage lists are grouped correctly.
  • Bug Fixes

    • Corrected feedback and Disqus display conditions based on configured services.
    • Improved remote footer loading with clearer build failures when unavailable.
  • Compatibility

    • Updated Hugo configuration and site templates to support newer Hugo versions and current configuration formats.

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]>
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f917dee1-e75a-437e-9916-5ec506316c3e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3203cf0 and 0468a61.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (14)
  • config.toml
  • docs/_index.md
  • docs/pages/docs-homepage.md
  • layouts/_default/content.html
  • layouts/api-reference/content.html
  • layouts/docs/list.html
  • layouts/home.html
  • layouts/partials/footer.html
  • layouts/partials/head-css.html
  • layouts/partials/section-index.html
  • layouts/swagger/list.html
  • netlify.toml
  • package.json
  • theme.toml

Comment thread docs/_index.md
Comment on lines +8 to +16
target:
path: "/*"
- type: "docs"
toc_root: true
_target:
target:
path: "/*/**"
- type: "docs"
toc_root: true
_target:
target:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🔴 Critical | ⚡ Quick win

YAML list marker misplacement during _targettarget 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 - from type: (lines 10, 14) to target: (lines 8, 12) and adjust indentation so path: nests under target: and type:/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 on target:, not type:.
📍 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant