Closed ffha closed 2 weeks ago
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.
If you just want to make it disappear:
[params]
social = true
not sure about any side effects though. 🤷🏻
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
OK, I will try.
I 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.
If you just want to make it disappear:
hugo.toml
[params] social = true
not sure about any side effects though. 🤷🏻
Thanks! That worked for me.
@adityatelange
Prior to v0.136.0 this emits a warning. With v0.136.0 and later this emits an error and fails the build.
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.
@IanJempson
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.
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.
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.
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.
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 -D
Have a good day.
@adityatelange
Prior to v0.136.0 this emits a warning. With v0.136.0 and later this emits an error and fails the build.
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.
@adityatelange
Found how to fix this issue.
Find opengraph.html
and twitter_cards.html
under themes/PaperMod/layouts/partials/templates/
, then
# twitter_cards.html
{{ with site.Social.twitter -}}
# change to
{{ with .Site.Params.Social.twitter -}}
# opengraph.html
{{- with site.Social.facebook_admin }}
# change to
{{- with .Site.Params.Social.facebook_admin }}
Just for people to know, a PR is out to fix this https://github.com/adityatelange/hugo-PaperMod/pull/1620
Also ran into this on builds using hugo's github action:
Run hugo --minify
hugo --minify
shell: /usr/bin/bash -e {0}
WARN deprecated: site config key paginate was deprecated in Hugo v0.128.0 and will be removed in a future release. Use pagination.pagerSize instead.
Start building sites …
hugo v0.136.5-46cccb021bc6425455f4eec093f5cc4a32f1d12c linux/amd64 BuildDate=2024-10-24T12:26:27Z VendorInfo=gohugoio
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 188 ms
Error: error building site: logged 1 error(s)
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.
@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 Found how to fix this issue. Find
opengraph.html
andtwitter_cards.html
underthemes/PaperMod/layouts/partials/templates/
, then# twitter_cards.html {{ with site.Social.twitter -}} # change to {{ with .Site.Params.Social.twitter -}} # opengraph.html {{- with site.Social.facebook_admin }} # change to {{- with .Site.Params.Social.facebook_admin }}
Yes, you are right, work. Thank you!
Upstream patches from Hugo and @jpmcb for templates are pushed. This should fix the issue.
Describe the bug
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.