diff options
author | Joe Mooring <[email protected]> | 2024-03-12 11:16:05 -0700 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2024-03-15 17:26:45 +0100 |
commit | d4d49e0f0ec53ef7e105c51b5c6fd198c86acb7e (patch) | |
tree | 886d5118def4fe3fe5bb5c293740d898be39b638 /tpl | |
parent | 78178d0c2a10e7793a41f8f66b3a4a6e4f70ef7e (diff) | |
download | hugo-d4d49e0f0ec53ef7e105c51b5c6fd198c86acb7e.tar.gz hugo-d4d49e0f0ec53ef7e105c51b5c6fd198c86acb7e.zip |
hugolib: Deprecate site methods Author, Authors, and Social
Closes #12228
Diffstat (limited to 'tpl')
-rw-r--r-- | tpl/tplimpl/embedded/templates/opengraph.html | 15 | ||||
-rw-r--r-- | tpl/tplimpl/embedded/templates/twitter_cards.html | 22 |
2 files changed, 11 insertions, 26 deletions
diff --git a/tpl/tplimpl/embedded/templates/opengraph.html b/tpl/tplimpl/embedded/templates/opengraph.html index f3f41121c..bbe4e5dd0 100644 --- a/tpl/tplimpl/embedded/templates/opengraph.html +++ b/tpl/tplimpl/embedded/templates/opengraph.html @@ -34,18 +34,11 @@ {{ end }}{{ end }} {{- end }} -{{- /* Deprecate site.Social.facebook_admin in favor of site.Params.social.facebook_admin */}} -{{- $facebookAdmin := "" }} +{{- /* Facebook Page Admin ID for Domain Insights */}} {{- with site.Params.social }} {{- if reflect.IsMap . }} - {{- $facebookAdmin = .facebook_admin }} - {{- end }} -{{- else }} - {{- with site.Social.facebook_admin }} - {{- $facebookAdmin = . }} - {{- warnf "The social key in site configuration is deprecated. Use params.social.facebook_admin instead." }} + {{- with .facebook_admin }} + <meta property="fb:admins" content="{{ . }}" /> + {{- end }} {{- end }} {{- end }} - -{{- /* Facebook Page Admin ID for Domain Insights */}} -{{ with $facebookAdmin }}<meta property="fb:admins" content="{{ . }}" />{{ end }} diff --git a/tpl/tplimpl/embedded/templates/twitter_cards.html b/tpl/tplimpl/embedded/templates/twitter_cards.html index e66a5029a..c445efdfc 100644 --- a/tpl/tplimpl/embedded/templates/twitter_cards.html +++ b/tpl/tplimpl/embedded/templates/twitter_cards.html @@ -8,23 +8,15 @@ <meta name="twitter:title" content="{{ .Title }}"/> <meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"/> -{{- /* Deprecate site.Social.twitter in favor of site.Params.social.twitter */}} {{- $twitterSite := "" }} {{- with site.Params.social }} {{- if reflect.IsMap . }} - {{- $twitterSite = .twitter }} + {{- with .twitter }} + {{- $content := . }} + {{- if not (strings.HasPrefix . "@") }} + {{- $content = printf "@%v" . }} + {{- end }} + <meta name="twitter:site" content="{{ $content }}"/> + {{- end }} {{- end }} -{{- else }} - {{- with site.Social.twitter }} - {{- $twitterSite = . }} - {{- warnf "The social key in site configuration is deprecated. Use params.social.twitter instead." }} - {{- end }} -{{- end }} - -{{- with $twitterSite }} - {{- $content := . }} - {{- if not (strings.HasPrefix . "@") }} - {{- $content = printf "@%v" $twitterSite }} - {{- end }} -<meta name="twitter:site" content="{{ $content }}"/> {{- end }} |