hugo-PaperMod: [BUG] Deprecation of .Site.Social
Describe the bug
- Device/Os: MacOS
- Type: Desktop
- Browser and version [e.g. Chrome 86.0]:
- Hugo Version: v0.131.0+extended
- Theme Version [e.g. v4.0, master, or commit-id ]: 9ea3bb0e1f3a
Steps to reproduce the behavior:
Using latest hugo version
Run hugo server
Expected behavior: No Deprecation notice
Repo/Source where this issue can be reproduced: N/A
Screenshots N/A
Additional context .Site.Social was deprecated in Hugo v0.124.0 and will be removed in a future release. Use .Site.Params instead.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 14
- Comments: 21 (4 by maintainers)
Commits related to this issue
- apply site.social deprecation workaround https://github.com/adityatelange/hugo-PaperMod/issues/1573 — committed to Bubbler-4/blog by Bubbler-4 2 years ago
- Update config.yml to avoid PaperMod failing to build https://github.com/adityatelange/hugo-PaperMod/issues/1573 — committed to artosalminen/artosalminen.github.io by artosalminen 2 years ago
- Add "social: true" to dodge Hugo deprecation error https://github.com/adityatelange/hugo-PaperMod/issues/1573#issuecomment-2415235233 — committed to 8hobbies/KamiMod-example-site by xuhdev 2 years ago
- Add "social: true" to dodge Hugo deprecation error (#39) https://github.com/adityatelange/hugo-PaperMod/issues/1573#issuecomment-2415235233 — committed to 8hobbies/KamiMod-example-site by xuhdev 2 years ago
- Add params.social: ture in hugo.yaml. A workaround for https://github.com/adityatelange/hugo-PaperMod/issues/1573. — committed to leomao/leomao.github.io by leomao 2 years ago
- workaround for https://github.com/adityatelange/hugo-PaperMod/issues/1573 — committed to nicomo/nicolasmorin by nicomo 2 years ago
- fix tag see https://github.com/adityatelange/hugo-PaperMod/issues/1573 — committed to contento/hugo.quickstart by contento 2 years ago
- config: Enable params.social Workaround for https://github.com/adityatelange/hugo-PaperMod/issues/1573 Until https://github.com/adityatelange/hugo-PaperMod/pull/1620 gets merged Signed-off-by: pengl... — committed to penglezos/penglezos.dev by penglezos 2 years ago
- As per https://github.com/adityatelange/hugo-PaperMod/issues/1573 adding social: true — committed to gjanders/gjanders.github.io by gjanders 2 years ago
- [fix] present social option so that site.Social isn't evaluated [BUG] Deprecation of .Site.Social #1573 https://github.com/adityatelange/hugo-PaperMod/issues/1573 — committed to mekkamagnus/mekkamagnus.github.io by mekkamagnus 2 years ago
- Fix .Site.Social error https://github.com/adityatelange/hugo-PaperMod/issues/1573 — committed to yo80106/hugo-theme-console by yo80106 2 years ago
- fix: papermod issue: https://github.com/adityatelange/hugo-PaperMod/issues/1573 — committed to suyogdahal/suyogdahal.github.io by suyogdahal 2 years ago
- hopefully work around the .Site.Social deprecation in hugo https://github.com/adityatelange/hugo-PaperMod/issues/1573#issuecomment-2297488347 — committed to pd-externals/tipoftheday-plugin by deleted user 2 years ago
- Fix hugo build .Site.Social was deprecated in Hugo v0.124.0 and subsequently removed. WonderMod hasn't been updated to support this change, so work around it by adding `social = true` to config.toml.... — committed to lberrymage/lberrymage.github.io by lberrymage 2 years ago
@adityatelange
Prior to v0.136.0 this emits a warning. With v0.136.0 and later this emits an error and fails the build.
If you just want to make it disappear:
hugo.toml
not sure about any side effects though. 🤷🏻
Finding difficult to keep up with Hugo’a pace of development. I work on a full time job with most saturdays working. Unable to keep aside some time for this at the moment. Very sorry.
Its a warning, chill WARN deprecated: .Site.Social was deprecated in Hugo v0.124.0 and will be removed in a future release. Use .Site.Params instead.
While it’s a warning that can be worked around, it means that the tutorial at https://gohugo.io/getting-started/quick-start/ doesn’t work. Following the tutorial steps of adding a post then running the server gives error messages. So the initial impression could be better.
I started the tutorial, thought this looks great, then within 15 minutes found myself dealing with an error message that told me what the problem was but not where the problem was.
@adityatelange Found how to fix this issue. Find
opengraph.htmlandtwitter_cards.htmlunderthemes/PaperMod/layouts/partials/templates/, thenI get the warning too. And I get the ways you can go to fix it. But it is a bug that will need to be addressed.
@IanJempson
Well, that behavior — that Hugo error messages frequently don’t include a file location where the error was encountered — is an issue for the Hugo developers (https://github.com/gohugoio/hugo/). The PaperMod theme creators have no control over the way Hugo displays error messages.
That tutorial uses the Ananke theme, not the PaperMod theme. So if you hit the error while following that tutorial, then it wasn’t an issue with PaperMod, and it can’t be addressed in the PaperMod theme.
Upstream patches from Hugo and @jpmcb for templates are pushed. This should fix the issue.
Also ran into this on builds using hugo’s github action:
@adityatelange - We appreciate all the incredible work that’s gone into this theme!! It’s been a big productivity boost for me personally. Please let the community know how we can continue to support you and this project!!
@adityatelange could you cut a new release please? This appears broken in v8.0
Yes, you are right, work. Thank you!
Just for people to know, a PR is out to fix this https://github.com/adityatelange/hugo-PaperMod/pull/1620
The previous error was due to a change in syntax. This correction directly uses the appropriate writing method of the new version, thus solving the problem.
Thank you. That worked.
Hello, I fixed it, please see below my solution.
grep -r "site\.Social"-> credit or go to file path: /themes/ananke/layouts/partials/social-share.html{{ with site.Params.Social.twitter }}hugo server -DHave a good day.
OK, I will try.
The reason you see the warning is because unless the social option is present, site.Social will be evaluated. https://github.com/adityatelange/hugo-PaperMod/blob/58c4841c26325eaa788d9b13e65d5dfc95d9367c/layouts/partials/templates/twitter_cards.html#L21-L30 & https://github.com/adityatelange/hugo-PaperMod/blob/58c4841c26325eaa788d9b13e65d5dfc95d9367c/layouts/partials/templates/opengraph.html#L46-L56