Skip to content

Upgrade to Hugo 0.160.1 - #2648

Merged
chalin merged 14 commits into
docsy:mainfrom
chalin:chalin-m24-hugo-0.160.1-2026-0612
Jun 12, 2026
Merged

chalin merged 14 commits into
docsy:mainfrom
chalin:chalin-m24-hugo-0.160.1-2026-0612

Conversation

@chalin

@chalin chalin commented Jun 12, 2026 •

Copy link
Copy Markdown
Collaborator

Tasks

  • Initial branch setup: dev version bump; drop tasks/0.16/hugo page (tracked externally for now)
  • Pin bumps (root config.hugo_version, docsy.dev hugo-extended) - both at 0.160.1; theme min stays 0.158.0
  • New tests/mono-site/ test base (towards Add golden tests #726): each test builds a minimal, monolingual, hook-free Hugo site against the local theme - offline and fast, unlike the smoke tests. Root script test:mono-site, included in npm test and CI (ci:post)
  • New mono-site check guarding & escaping in rendered Markdown link URLs (the 0.159.2 regression class, Possible regression: ampersands in Markdown link URLs getting double-escaped: & gohugoio/hugo#14715): a mono-site fixture (monolingual, no link hooks - the only exposed rendering path) seeds a &-bearing link and asserts single escaping. Red/green verified (twice: in its interim smoke-test home, then re-verified after the move): the test fails at 0.159.2 (& in output) and passes at 0.160.1. Earlier attempts (md-output golden, docsy.dev HTML assertion) were dropped: the md output format passes URLs through unrendered, and docsy.dev itself is shielded (multilingual single-host sites silently use the embedded link render hook)
  • Build + full test suite at 0.160.1: zero deprecation notices; md-output goldens from 0.158.0 match 0.160.1 output byte-for-byte (output-neutrality check)
  • Changelog entry
  • Smoke tests (3 site flavors, against the pushed branch)

- package.json version -> 0.15.1-dev+003-over-main-5c5733de
- Remove tasks/0.16/hugo/index.md: the Hugo upgrade work for 0.16 is
  tracked in maintainer-local pages for now; a summary will land with
  the 0.16 release notes.
@chalin chalin mentioned this pull request Jun 12, 2026
7 of 8 tasks
chalin added 4 commits June 12, 2026 05:41
Hugo 0.159.2's dangerous-URL escaping fix double-escaped ampersands in
Markdown link URLs on sites without link render hooks (gohugoio/hugo#14715,
fixed in 0.160.0). Add docs/content/navigation/index.md (which contains
&-bearing link URLs) to the md-output goldens so this regression class is
guarded going forward. Golden generated and verified at Hugo 0.158.0.
Combined 0.158.0 -> 0.160.1 bump (covers 0.159.x and 0.160.x):

- 0.159.2: security fix - dangerous-URL escaping in Markdown links/images
- 0.160.0: fixes the &-double-escaping regression that 0.159.2 introduced
  (gohugoio/hugo#14715); guarded by the new md-output golden
- 0.160.1: panic fixes (passthrough-in-headings, template edits while
  serving)

No new deprecations in this range; theme min Hugo version stays 0.158.0.

Pins: package.json config.hugo_version and docsy.dev hugo-extended.

Validation: zero deprecation notices; full test suite passes; md-output
goldens generated at 0.158.0 match 0.160.1 output byte-for-byte (incl.
&-bearing link URLs).
@chalin
chalin marked this pull request as ready for review June 12, 2026 10:01
chalin added 9 commits June 12, 2026 06:03
Verification at 0.159.2 showed the md-output golden cannot catch the
&-double-escaping regression (gohugoio/hugo#14715): the md output format
passes link URLs through unrendered, and this site's HTML is shielded
anyway - multilingual single-host sites get renderHooks.link.useEmbedded
'fallback' (embedded hook), and hooked sites are immune. Only monolingual
sites without link hooks were affected.

Replace the golden (not worth its maintenance cost) with a targeted
assertion in the hugo-build suite: rendered HTML must escape & in
Markdown link URLs exactly once (no & anywhere on the page).
The docsy.dev hugo-build assertion added in the previous commit had no
true value: this site is immune to the gohugoio/hugo#14715 regression
class (multilingual single-host sites silently use the embedded link
render hook), so the assertion could never fail for the affected code
path.

The smoke-test sites are the right vehicle: hugo new site produces a
monolingual site with no link render hooks - goldmark's plain link
rendering, the only path 0.159.2 broke. Seed the clone-flavor site with
a &-bearing Markdown link and assert the rendered HTML escapes it
exactly once. Verified: this check fails under Hugo 0.159.2 (per the
minimal reprex) and passes at 0.160.1.
New tests/mono-site/ series at the repo root: each test builds a minimal,
monolingual, hook-free Hugo site against the local theme (offline and
fast, unlike the smoke tests, which fetch Docsy from GitHub). Harness in
tests/mono-site/lib/build-site.mjs. Runs via test:mono-site, included in
'npm test' (fix-and-test) and CI (ci:post).

Moves the hugo#14715 amp-escaping regression guard out of the smoke tests
into this base. Red/green re-verified in its new home: fails at
[email protected], passes at 0.160.1.

Towards docsy#726.
The theme imports Hugo modules (Font-Awesome, bootstrap); non-module
consumers need the empty github.com/... placeholder dirs at the themesDir
root. Present locally as install leftovers, but absent in CI, where the
fixture build failed with "module ... Font-Awesome not found". Reuse
scripts/mkdirp-hugo-mod.js in the harness. Red/green verified locally by
removing github.com/ first.
Upgrade guidance (0.159.2+ security recommendation, #14715 regression
nuance) moves to the upcoming Hugo-upgrade blog post, per content
placement policy: the changelog stays a lean record of what changed.
- amp-escaping: explicitly reject the double-escaped & form for
  self-documenting failures
- build-site harness: fail loudly if mkdirp-hugo-mod.js fails, instead of
  surfacing only as an opaque Hugo module error
Review follow-ups for docsy#2648:

- Document the content placement policy (changelog vs release/upgrade
  blogs vs site docs vs code comments) that has been applied informally.
- Add a test-suite overview table; test:mono-site was added in this PR
  and the tiers were previously undocumented.
- Hugo version pins: clarify when to skip set:hugo:version and manually
  bump only the build pins (params.hugoMinVersion is user-facing; this
  PR is such a build-only bump).
@chalin
chalin merged commit 3e76f1f into docsy:main Jun 12, 2026
15 checks passed
@chalin
chalin deleted the chalin-m24-hugo-0.160.1-2026-0612 branch June 12, 2026 12:38
@chalin chalin added this to the 0.16.0 milestone Jun 26, 2026
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