From 17bf2efa4c113e30112a34e3fb0354da9148f16f Mon Sep 17 00:00:00 2001 From: Hong Xu Date: Wed, 14 Aug 2024 13:07:07 -0700 Subject: [PATCH 1/4] Remove the use of .Site.DisqusShortname (#511) In version 0.132.0, this now leads to an error: > ERROR deprecated: .Site.DisqusShortname was deprecated in Hugo v0.120.0 and will be removed in Hugo 0.133.0. Use .Site.Config.Services.Disqus.Shortname instead. --- layouts/_default/baseof.html | 4 ---- 1 file changed, 4 deletions(-) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 44f42463..d9870a1f 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -2,10 +2,6 @@ {{ errorf "Please use Hugo version 0.120.0 or higher!" }} {{ end }} -{{ if not (eq .Site.DisqusShortname "") }} - {{ errorf "Your use of disqusShortname is deprecated by Hugo; Please reference the README.md for further instructions. This error message will be removed in the future because we are also using .Site.DisqusShortname for checking this." }} -{{ end }} - From acbc3efe06ebd82b6df37222aca6faad3b249047 Mon Sep 17 00:00:00 2001 From: Andreas Deininger Date: Wed, 14 Aug 2024 22:07:51 +0200 Subject: [PATCH 2/4] Fix deprecation warnings (#510) --- .github/workflows/ci.yml | 6 +++--- .github/workflows/hugo.yml | 8 ++++---- exampleSite/hugo.toml | 8 ++++++-- layouts/_default/baseof.html | 4 ++-- layouts/partials/footer.html | 4 ++-- layouts/partials/nav.html | 2 +- layouts/partials/seo/structured/post.html | 2 +- netlify.toml | 2 +- theme.toml | 2 +- 9 files changed, 21 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 118a4259..6c3ae26f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: build: runs-on: ubuntu-latest env: - HUGO_VERSION: 0.120.1 + HUGO_VERSION: 0.130.0 steps: - name: Install Hugo CLI run: | @@ -31,7 +31,7 @@ jobs: submodules: recursive - name: Setup Pages id: pages - uses: actions/configure-pages@v3 + uses: actions/configure-pages@v5 - name: Build with Hugo env: # For maximum backward compatibility with Hugo modules @@ -45,7 +45,7 @@ jobs: --themesDir "../../" --logLevel info - name: Upload artifact - uses: actions/upload-pages-artifact@v2 + uses: actions/upload-pages-artifact@v3 with: path: ./exampleSite/public diff --git a/.github/workflows/hugo.yml b/.github/workflows/hugo.yml index 015785be..8cb72026 100644 --- a/.github/workflows/hugo.yml +++ b/.github/workflows/hugo.yml @@ -26,7 +26,7 @@ jobs: build: runs-on: ubuntu-latest env: - HUGO_VERSION: 0.120.1 + HUGO_VERSION: 0.130.0 steps: - name: Install Hugo CLI run: | @@ -38,7 +38,7 @@ jobs: submodules: recursive - name: Setup Pages id: pages - uses: actions/configure-pages@v3 + uses: actions/configure-pages@v5 - name: Build with Hugo env: # For maximum backward compatibility with Hugo modules @@ -51,7 +51,7 @@ jobs: -s "./exampleSite/" \ --themesDir "../../" - name: Upload artifact - uses: actions/upload-pages-artifact@v2 + uses: actions/upload-pages-artifact@v3 with: path: ./exampleSite/public @@ -69,4 +69,4 @@ jobs: success() && github.ref == 'refs/heads/master' && github.repository == 'halogenica/beautifulhugo' - uses: actions/deploy-pages@v2 + uses: actions/deploy-pages@v4 diff --git a/exampleSite/hugo.toml b/exampleSite/hugo.toml index 4744a0e7..118bf440 100644 --- a/exampleSite/hugo.toml +++ b/exampleSite/hugo.toml @@ -11,8 +11,12 @@ pygmentsCodeFences = true pygmentsCodefencesGuessSyntax = true #pygmentsUseClassic = true #pygmentOptions = "linenos=inline" -#disqusShortname = "XXX" -#googleAnalytics = "XXX" + +[Services] + [Services.Disqus] + # Shortname = "XXX" + [Services.googleAnalytics] + # id = "XXX" [Params] # homeTitle = "Beautiful Hugo Theme" # Set a different text for the header on the home page diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index d9870a1f..92057637 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,5 +1,5 @@ -{{ if le hugo.Version "0.120.0" }} - {{ errorf "Please use Hugo version 0.120.0 or higher!" }} +{{ if le hugo.Version "0.124.0" }} + {{ errorf "Please use Hugo version 0.124.0 or higher!" }} {{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 2b52f2d5..ebfe510c 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -56,9 +56,9 @@  • © {{ if .Site.Params.since }} - {{ .Site.Params.since }} - {{ .Site.LastChange.Format "2006" }} + {{ .Site.Params.since }} - {{ .Site.Lastmod.Format "2006" }} {{ else }} - {{ .Site.LastChange.Format "2006" }} + {{ .Site.Lastmod.Format "2006" }} {{ end }} {{ if .Site.Title }} diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html index 5594b294..78cf457d 100644 --- a/layouts/partials/nav.html +++ b/layouts/partials/nav.html @@ -29,7 +29,7 @@ {{ end }} {{ end }} - {{ if .Site.IsMultiLingual }} + {{ if hugo.IsMultilingual }} {{ if ge (len .Site.Languages) 3 }}