Removed deprecated code breaking my hugo deployment
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.htmlto remove fallback tosite.Social.facebook_admin - Updating
twitter_cards.htmlto remove fallback tosite.Social.twitter - Removing deprecated code blocks referencing
site.Socialin 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.
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
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)
It works as intended, thanks for the fix!
Thanks for the PR. This is fixed with 65bd711a3baf2521f311f26d3dad46992aa853cf