Skip to content

Fix Hugo deprecation warnings - #101

Merged
ramereth merged 1 commit into
mainfrom
hugo-deprecations
Aug 12, 2026
Merged

Fix Hugo deprecation warnings#101
ramereth merged 1 commit into
mainfrom
hugo-deprecations

Conversation

@ramereth

Copy link
Copy Markdown
Member

Hugo 0.165 on web2 emits two deprecation warnings on every build:

WARN deprecated: project config key languageCode was deprecated in Hugo v0.158.0 ... Use locale instead.
WARN deprecated: .Site.Data was deprecated in Hugo v0.156.0 ... Use hugo.Data instead.
  • config/_default/hugo.toml: languageCodelocale.
  • Nine site.Data lookups in layouts/home.html and the shortcodes → hugo.Data. The $site.Data.Integrity in layouts/baseof.html is a resource's .Data (fingerprint SRI hash), not site data, so it is unchanged.

Verification

Built both before and after with hugo_extended_0.165.0 (matching web2):

  • Before: 2 warnings. After: no warnings.
  • diff -rq of the full public/ tree before vs. after: no differences — the rendered site is byte-identical, including <language>en-us</language> in the RSS feeds.

Note

This raises the minimum Hugo version to v0.158.0 (hugo.Data needs ≥0.156, locale needs ≥0.158). web2 is on v0.165.0 so CI is fine, but anyone still on an older local Hugo will need to upgrade — an older binary fails with can't evaluate field Data in type interface {}.

🤖 Generated with Claude Code

Hugo 0.165 on web2 emits two deprecation warnings on every build:

  languageCode was deprecated in v0.158.0, use locale instead
  .Site.Data was deprecated in v0.156.0, use hugo.Data instead

Rename the config key and switch the nine site.Data lookups in the
home layout and shortcodes over to hugo.Data. The $site.Data.Integrity
in baseof.html is a resource's .Data, not site data, so it stays.

Builds are byte-identical to before the change and now warning-free.
This raises the minimum Hugo to v0.158.0; web2 runs v0.165.0.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Lance Albertson <lance@osuosl.org>
@ramereth
ramereth merged commit bce46fe into main Aug 12, 2026
5 checks passed
@ramereth
ramereth deleted the hugo-deprecations branch August 12, 2026 20:09
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