diff options
author | Joe Mooring <joe.mooring@veriphor.com> | 2023-10-16 17:43:11 -0700 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2023-10-17 20:04:24 +0200 |
commit | 4910312ee75a1c67fad68c259ad9576dca854c62 (patch) | |
tree | 8944afb966b5a2ca7b3be78eb232f685f249745f /tpl | |
parent | 1b5f78b6b7335b02b6207a637498c4c8817999d1 (diff) |
tpl/tplimpl: Deprecate .Site.Social usage with internal templates
Diffstat (limited to 'tpl')
-rw-r--r-- | tpl/tplimpl/embedded/templates/opengraph.html | 13 | ||||
-rw-r--r-- | tpl/tplimpl/embedded/templates/twitter_cards.html | 16 |
2 files changed, 26 insertions, 3 deletions
diff --git a/tpl/tplimpl/embedded/templates/opengraph.html b/tpl/tplimpl/embedded/templates/opengraph.html index a9d4dd83c..f5a4ebd9f 100644 --- a/tpl/tplimpl/embedded/templates/opengraph.html +++ b/tpl/tplimpl/embedded/templates/opengraph.html @@ -42,5 +42,16 @@ {{ end }}{{ end }} {{- end }} +{{- /* Deprecate site.Social.facebook_admin in favor of site.Params.social.facebook_admin */}} +{{- $facebookAdmin := "" }} +{{- with site.Params.social.facebook_admin }} + {{- $facebookAdmin = . }} +{{- else }} + {{- with site.Social.facebook_admin }} + {{- $facebookAdmin = . }} + {{- warnf "The social key in site configuration is deprecated. Use params.social.facebook_admin instead." }} + {{- end }} +{{- end }} + {{- /* Facebook Page Admin ID for Domain Insights */}} -{{- with .Site.Social.facebook_admin }}<meta property="fb:admins" content="{{ . }}" />{{ end }} +{{ 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 83a3b79c4..4a753bba6 100644 --- a/tpl/tplimpl/embedded/templates/twitter_cards.html +++ b/tpl/tplimpl/embedded/templates/twitter_cards.html @@ -19,6 +19,18 @@ {{- end }} <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 -}}"/> -{{ with .Site.Social.twitter -}} + +{{- /* Deprecate site.Social.twitter in favor of site.Params.social.twitter */}} +{{- $twitterSite := "" }} +{{- with site.Params.social.twitter }} + {{- $twitterSite = . }} +{{- else }} + {{- with site.Social.twitter }} + {{- $twitterSite = . }} + {{- warnf "The social key in site configuration is deprecated. Use params.social.twitter instead." }} + {{- end }} +{{- end }} + +{{- with $twitterSite }} <meta name="twitter:site" content="@{{ . }}"/> -{{ end -}} +{{- end }} |