diff --git a/layouts/partials/opengraph.html b/layouts/partials/opengraph.html index 046119d150..a79c42b9ce 100644 --- a/layouts/partials/opengraph.html +++ b/layouts/partials/opengraph.html @@ -115,7 +115,10 @@ {{- else }} {{- with site.Social.facebook_admin }} {{- $facebookAdmin = . }} - {{- warnf "The social key in site configuration is deprecated. Use params.social.facebook_admin instead." }} + {{- $hugoVersion := "0.120.0" }} + {{- if ge hugo.Version $hugoVersion }} + {{- warnf "The social key in site configuration is deprecated. Use params.social.facebook_admin instead." }} + {{- end }} {{- end }} {{- end }} diff --git a/layouts/partials/twitter_cards.html b/layouts/partials/twitter_cards.html index 9a69d25ad5..51a92a069a 100644 --- a/layouts/partials/twitter_cards.html +++ b/layouts/partials/twitter_cards.html @@ -51,7 +51,10 @@ {{- else }} {{- with site.Social.twitter }} {{- $twitterSite = . }} - {{- warnf "The social key in site configuration is deprecated. Use params.social.twitter instead." }} + {{- $hugoVersion := "0.120.0" }} + {{- if ge hugo.Version $hugoVersion }} + {{- warnf "The social key in site configuration is deprecated. Use params.social.twitter instead." }} + {{- end }} {{- end }} {{- end }}