Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed deprecated code breaking my hugo deployment #1620

Closed
wants to merge 1 commit into from

Conversation

l50
Copy link

@l50 l50 commented Oct 17, 2024

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.
  • I have enabled maintainer edits for this PR.
  • 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.
  • This change does not include any CDN resources/links.
  • This change does not include any unrelated scripts such as bash and python scripts.
  • This change updates the overridden internal templates from HUGO's repository.

Copy link

@godber
Copy link

godber commented Oct 23, 2024

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)

Copy link

@mtardy mtardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, this is an appropriate fix :)

@penglezos
Copy link

It works as intended, thanks for the fix!

penglezos added a commit to penglezos/penglezos.dev that referenced this pull request Oct 25, 2024
Copy link

@jpmcb jpmcb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally using l50:master and LGTM!! 🚀

Closes: #1573

LSXiang added a commit to LSXiang/hugo-PaperMod that referenced this pull request Oct 29, 2024
tuchaVshortah added a commit to tuchaVshortah/tuchaVshortah.github.io that referenced this pull request Oct 30, 2024
… in Hugo 0.137.0. Implement taxonomy 'social' or use .Site.Params.Social instead.

Fixed by using another fork of papermod with a fix applied:
adityatelange/hugo-PaperMod#1620
kinshuk4 added a commit to kinshuk4/hugo-paper-mod that referenced this pull request Nov 3, 2024
Copy link

@kinshuk4 kinshuk4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works, thanks for sharing it!

@adityatelange
Copy link
Owner

Thanks for the PR. This is fixed with 65bd711

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants