Skip to content

Hugo deprecation warnings on v0.164 can't be resolved without raising the v0.146.0 floor #2049

Description

@markdumay

Problem or enhancement idea

Building Hinode's own exampleSite with Hugo v0.164.0 currently logs 8 distinct deprecation warnings, spanning core and several mod-* dependencies:

Warning Deprecated in Source Replacement Replacement introduced in
module.mounts.includeFiles / excludeFiles v0.153.0 several mod-* config.toml (mod-bootstrap, mod-katex, mod-blocks, mod-leaflet, mod-simple-datatables, mod-bootstrap-icons) files mount setting v0.153.0
.Site.AllPages v0.156.0 layouts/index.redir:6 range hugo.Sites v0.156.0
.Site.Data v0.156.0 mod-utils layer hugo.Data v0.156.0
.Site.Languages v0.156.0 layouts/_partials/head/head.html:49 range hugo.Sites + .Language v0.156.0
Image.Exif v0.155.0 mod-utils/layouts/_partials/utilities/GetImage.html Resource.Meta v0.155.3
config key languageCode v0.158.0 config/_default/hugo.toml:24 locale v0.158.0
config key languages.<lang>.languageName v0.158.0 config/_default/languages.toml:3 languages.<lang>.label v0.158.0
.Language.LanguageName (template) v0.158.0 layouts/_partials/assets/helpers/navbar-languages.html:28,37 .Language.Label v0.158.0

config/_default/hugo.toml currently declares module.hugoVersion.min = "0.146.0". Every replacement API listed above was introduced after that floor (lowest is v0.153.0, highest is v0.158.0), so none of these warnings can be resolved today without silently raising Hinode's real minimum Hugo requirement above what it advertises. None of the old calls are removed yet in v0.164.0 — this is pure warning noise for now, not a functional break.

Proposed solution

Treat all 8 as a single batch tied to a future bump of module.hugoVersion.min to at least 0.158.0 (the highest replacement-introduction version in the table), rather than fixing them piecemeal. At that point all 8 can be swapped for their modern equivalents in one pass across hinode and the affected mod-* repos.

One more data point worth factoring into when that floor should move: Hinode's Bookshop dependency already hard-pins an actual gohugoio/hugo Go module internally. full-hugo-renderer/go.mod (used by github.com/cloudcannon/bookshop/hugo) requires:

https://github.com/CloudCannon/bookshop/blob/23a20b58fccb7af4079627950d940dd72056a232/javascript-modules/engines/hugo-engine/full-hugo-renderer/go.mod#L6

require (
	github.com/gohugoio/hugo v0.147.6
	github.com/spf13/afero v1.14.0
)

That's already above the advertised min = "0.146.0" floor today, via a core dependency rather than anything in Hinode's own templates. Worth confirming whether the advertised floor should already reflect this, independent of the deprecation-warning cleanup above.

Alternatives

The three template-level warnings (.Site.AllPages, .Site.Languages, .Language.LanguageName) could in principle be silenced without raising the floor, using a {{ if ge hugo.Version "0.15x.0" }}...{{ else }}...{{ end }} branch — there's existing precedent for this pattern in layouts/_partials/assets/toc-headings.html:22. I don't think it's worth the added branching complexity just to silence a cosmetic warning, but flagging it as an option.

The four config-key warnings (includeFiles/excludeFiles, languageCode, languageName) can't be dual-pathed this way at all — TOML config isn't conditionally evaluated per Hugo version — so those are simply stuck until the floor moves.

Additional context

Reproduced against hinode HEAD (b3e90fa) using the project-pinned node_modules/.bin/hugo v0.164.0 via pnpm build:example:ci. Full warning output available on request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions