Repository navigation
Upgrade to Hugo 0.160.1 - #2648
Merged
Merged
Conversation
- 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.
7 of 8 tasks
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
marked this pull request as ready for review
June 12, 2026 10:01
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).
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.
&-escaping regression it introduced (Possible regression: ampersands in Markdown link URLs getting double-escaped: & gohugoio/hugo#14715). No new deprecations in this range.Tasks
tasks/0.16/hugopage (tracked externally for now)config.hugo_version, docsy.devhugo-extended) - both at 0.160.1; theme min stays 0.158.0tests/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 scripttest:mono-site, included innpm testand CI (ci:post)&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)