Skip to content

Comments

Upgrade the Hugo version#2134

Merged
dscho merged 3 commits intogit:gh-pagesfrom
dscho:upgrade-hugo
Feb 20, 2026
Merged

Upgrade the Hugo version#2134
dscho merged 3 commits intogit:gh-pagesfrom
dscho:upgrade-hugo

Conversation

@dscho
Copy link
Member

@dscho dscho commented Feb 17, 2026

Changes

  • Pre-emptively fixes an issue Hugo v0.152+ would have with our data/docs.yml by converting it to JSON
  • Upgrades to newest Hugo (v0.155.3)

Context

It's always good to stay up to date with dependencies. Our principal dependency, Hugo, occasionally introduces breaking changes and it is good to stay on top of those changes by adapting your site accordingly.

This simplifies keeping the site up to date with the latest releases.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Hugo v0.155.3 upgraded its go-yaml dependency to v3, which internally
counts structurally identical non-scalar YAML nodes (maps, sequences) as
"aliases" even when the file contains no explicit YAML anchors or alias
references. The default limit is 10,000 such nodes, and docs.yml exceeds
that threshold because many of its ~310 manual pages share identical
single-key maps like `{name: "2.53.0"}` in their version lists.

Switching the serialization format from YAML to JSON sidesteps the
go-yaml parser entirely. Hugo supports JSON data files natively via
the file extension, so templates continue to access the data through
`.Site.Data.docs` without any changes.

The `&rarr;` HTML entity in version range labels is replaced with the
literal Unicode arrow `→` since JSON does not need HTML entity encoding
and the character renders identically in browsers.

A `convert_timestamps` helper is added to `read_data` because JSON has
no native timestamp type: `committed` values are serialized as strings
by `JSON.dump` and must be parsed back to Ruby `Time` objects for the
`>=` comparisons and `.strftime` calls in the indexing logic. The now
unnecessary `yaml_dump_quoted` helper (which was an earlier, incorrect
attempt to work around this problem by quoting `&`-containing values)
is removed.

The existing `docs.yml` was converted to `docs.json` via:

  ruby -ryaml -rjson -e \
    "data = YAML.load_file('external/docs/data/docs.yml'); \
     File.write('external/docs/data/docs.json', JSON.dump(data))"

Assisted-by: Claude Opus 4.6
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
There have been a couple of changes recently that _might_ require
updates to how we build the site.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho changed the title Upgrade hugo Upgrade the Hugo version Feb 17, 2026
@dscho
Copy link
Member Author

dscho commented Feb 20, 2026

Since this passes the PR checks, and since the conversion from YAML to JSON is prone to cause merge conflicts before long if left unmerged, I'm going ahead and merge it now.

@dscho dscho merged commit f3484ca into git:gh-pages Feb 20, 2026
1 check passed
@dscho dscho deleted the upgrade-hugo branch February 20, 2026 19:30
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