hugo-PaperMod icon indicating copy to clipboard operation
hugo-PaperMod copied to clipboard

Removed deprecated code breaking my hugo deployment

Open l50 opened this issue 1 year ago • 1 comments

What does this PR change? What problem does it solve? This PR removes deprecated site.Social references from Hugo templates and updates them to use site.Params.social exclusively. It eliminates deprecation warnings for Facebook and Twitter social configs and simplifies the logic for retrieving social media configuration values. These changes resolved deploy issues that I was experiencing - trunk appears to be broken.

Key changes include:

  • Modifying opengraph.html to remove fallback to site.Social.facebook_admin
  • Updating twitter_cards.html to remove fallback to site.Social.twitter
  • Removing deprecated code blocks referencing site.Social in both template files
  • Eliminating warning messages about deprecated social key usage in site configuration

This change resolves deployment issues caused by deprecated Hugo configuration syntax, ensuring compatibility with the latest Hugo versions and removing potential sources of errors or warnings during site builds.

PR Checklist

  • [ ] This change adds/updates translations and I have used the template present here.
  • [x] I have enabled maintainer edits for this PR.
  • [x] I have verified that the code works as described/as intended.
  • [ ] This change adds a Social Icon which has a permissive license to use it.
  • [x] This change does not include any CDN resources/links.
  • [x] This change does not include any unrelated scripts such as bash and python scripts.
  • [x] This change updates the overridden internal templates from HUGO's repository.

l50 avatar Oct 17 '24 18:10 l50

This change appears to have fixed the problem I encountered when using this theme on the following Hugo version.

hugo version
hugo v0.136.1+extended darwin/arm64 BuildDate=2024-10-16T16:05:18Z VendorInfo=brew

Without this change, the following error would prevent builds:

hugo build
Start building sites …
hugo v0.136.1+extended darwin/arm64 BuildDate=2024-10-16T16:05:18Z VendorInfo=brew

ERROR deprecated: .Site.Social was deprecated in Hugo v0.124.0 and will be removed in Hugo 0.137.0. Implement taxonomy 'social' or use .Site.Params.Social instead.
Total in 75 ms
Error: error building site: logged 1 error(s)

godber avatar Oct 23 '24 14:10 godber

It works as intended, thanks for the fix!

penglezos avatar Oct 25 '24 19:10 penglezos

Thanks for the PR. This is fixed with 65bd711a3baf2521f311f26d3dad46992aa853cf

adityatelange avatar Nov 09 '24 05:11 adityatelange