From a5d59c7d44ca57b3a1ccc7f089f25af1150cfea9 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sun, 18 Oct 2026 19:27:30 +0530 Subject: [PATCH] Fix/hugo v0.158.0 deprecations (#1884) * fix(layouts): use non-deprecated .Language methods Hugo v0.158.0 deprecated these in favour of new names: - .Language.LanguageDirection -> .Language.Direction - .Language.LanguageCode -> .Language.Locale - .Language.LanguageName -> .Language.Label Fixes the deprecation warnings shown on every build. Requires Hugo v0.158.0 or later. Closes #1856 * chore(theme): bump minimum hugo version to v0.158.0 * fix(schema_json): replace deprecated .Language.Lang with .Language.Name ref: https://discourse.gohugo.io/t/deprecations-in-v0-158-0/56869 --- .github/ISSUE_TEMPLATE/bug.yaml | 4 ++-- .github/workflows/build-check.yml | 4 ++-- README.md | 2 +- layouts/_partials/header.html | 8 ++++---- layouts/_partials/templates/opengraph.html | 2 +- layouts/_partials/templates/schema_json.html | 2 +- layouts/_partials/translation_list.html | 4 ++-- layouts/baseof.html | 10 +++++----- layouts/rss.xml | 2 +- theme.toml | 2 +- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug.yaml b/.github/ISSUE_TEMPLATE/bug.yaml index d7d76567..0bd72e88 100644 --- a/.github/ISSUE_TEMPLATE/bug.yaml +++ b/.github/ISSUE_TEMPLATE/bug.yaml @@ -39,8 +39,8 @@ body: label: Hugo Version description: What version of Hugo are you running? options: - - Hugo >= 0.146.0 (Recommended - Minimum version required for PaperMod) - - Hugo < 0.146.0 (Incompatible - Not recommended to build PaperMod on lower versions) + - Hugo >= 0.158.0 (Recommended - Minimum version required for PaperMod) + - Hugo < 0.158.0 (Incompatible - Not recommended to build PaperMod on lower versions) validations: required: true - type: input diff --git a/.github/workflows/build-check.yml b/.github/workflows/build-check.yml index 3f239dd2..c297ce03 100644 --- a/.github/workflows/build-check.yml +++ b/.github/workflows/build-check.yml @@ -23,7 +23,7 @@ on: hugoVersion: description: "Hugo Version" required: false - default: "0.146.0" + default: "0.158.0" defaults: run: @@ -34,7 +34,7 @@ jobs: runs-on: ubuntu-latest env: # min_version from theme.toml - HUGO_VERSION: ${{ github.event.inputs.hugoVersion || '0.146.0' }} + HUGO_VERSION: ${{ github.event.inputs.hugoVersion || '0.158.0' }} steps: - name: Install Hugo CLI run: | diff --git a/README.md b/README.md index 41b898af..0b538e63 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ **A fast, clean, and responsive theme for [Hugo](https://gohugo.io/).** [](https://themes.gohugo.io/themes/hugo-papermod/) -[](https://github.com/gohugoio/hugo/releases/tag/v0.146.0) +[](https://github.com/gohugoio/hugo/releases/tag/v0.158.0) [](https://discord.gg/ahpmTvhVmp) > Based on [hugo-paper](https://github.com/nanxiaobei/hugo-paper/tree/4330c8b12aa48bfdecbcad6ad66145f679a430b3), with additional features and customization options. diff --git a/layouts/_partials/header.html b/layouts/_partials/header.html index 1abc9f5a..311f1d50 100644 --- a/layouts/_partials/header.html +++ b/layouts/_partials/header.html @@ -67,10 +67,10 @@ {{- range . -}} {{- if ne $lang .Lang }}