tpl/tplimpl: Deprecate .Site.Social usage with internal templates

This commit is contained in:
Joe Mooring
2023-10-16 17:43:11 -07:00
committed by Bjørn Erik Pedersen
parent 1b5f78b6b7
commit 4910312ee7
3 changed files with 30 additions and 7 deletions

View File

@@ -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 }}