From a48a6fa2dd47f4d52a96187785a1147050306b87 Mon Sep 17 00:00:00 2001 From: Guillaume Rivier Date: Wed, 10 Jul 2024 22:57:24 +0900 Subject: [PATCH] Site.Author is deprecated, use Params.author instead (#481) * Site.Author is deprecated, use Params.author instead * Update footer.html * Update footer.html * Update footer.html * Update footer.html * Update footer.html * Update footer.html * Update footer.html * Update ci.yml * Update ci.yml * Update footer.html * Update ci.yml * Update ci.yml --------- Co-authored-by: Henry Schreiner --- .github/workflows/ci.yml | 13 +++++++------ exampleSite/hugo.toml | 2 +- layouts/partials/footer.html | 19 +++++++++++-------- layouts/partials/head.html | 2 +- layouts/partials/post_meta.html | 2 +- layouts/partials/seo/structured/article.html | 2 +- layouts/partials/seo/structured/post.html | 4 ++-- layouts/partials/seo/twitter.html | 2 +- layouts/partials/share-links.html | 2 +- 9 files changed, 26 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c35640b..118a4259 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,12 +37,13 @@ jobs: # For maximum backward compatibility with Hugo modules HUGO_ENVIRONMENT: production HUGO_ENV: production - run: | - hugo \ - --minify \ - --baseURL "${{ steps.pages.outputs.base_url }}/" \ - -s "./exampleSite/" \ - --themesDir "../../" + run: > + hugo + --minify + --baseURL "${{ steps.pages.outputs.base_url }}/" + -s "./exampleSite/" + --themesDir "../../" + --logLevel info - name: Upload artifact uses: actions/upload-pages-artifact@v2 with: diff --git a/exampleSite/hugo.toml b/exampleSite/hugo.toml index f0d8e264..4744a0e7 100644 --- a/exampleSite/hugo.toml +++ b/exampleSite/hugo.toml @@ -47,7 +47,7 @@ pygmentsCodefencesGuessSyntax = true # src = "img/hexagon.jpg" # desc = "Hexagon" -[Author] +[Params.author] # Set only your "username" for default hosts and full URLs otherwise (e.g., "https://MyGitLab.org/username") name = "Some Person" website = "yourwebsite.com" diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 74994a67..ead747de 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,6 +1,9 @@ {{ if eq .Type "page" }} {{ partial "page_meta.html" . }} {{ end }} + {{- if and (not (isset .Site.Params "author")) (isset .Site "author") -}} + {{ errorf "Please move [author] to [params.author]; Hugo has deprecated the former." }} + {{- end -}}