diff --git a/layouts/partials/templates/opengraph.html b/layouts/partials/templates/opengraph.html index b7fe84c7..38fbd246 100644 --- a/layouts/partials/templates/opengraph.html +++ b/layouts/partials/templates/opengraph.html @@ -52,8 +52,10 @@ {{- /* Deprecate site.Social.facebook_admin in favor of site.Params.social.facebook_admin */}} {{- $facebookAdmin := "" }} -{{- with site.Params.social.facebook_admin }} - {{- $facebookAdmin = . }} +{{- with site.Params.social }} + {{- if reflect.IsMap . }} + {{- $facebookAdmin = .facebook_admin }} + {{- end }} {{- else }} {{- with site.Social.facebook_admin }} {{- $facebookAdmin = . }} diff --git a/layouts/partials/templates/twitter_cards.html b/layouts/partials/templates/twitter_cards.html index bdb59239..0e7760aa 100644 --- a/layouts/partials/templates/twitter_cards.html +++ b/layouts/partials/templates/twitter_cards.html @@ -30,8 +30,10 @@ {{- /* Deprecate site.Social.twitter in favor of site.Params.social.twitter */}} {{- $twitterSite := "" }} -{{- with site.Params.social.twitter }} - {{- $twitterSite = . }} +{{- with site.Params.social }} + {{- if reflect.IsMap . }} + {{- $twitterSite = .twitter }} + {{- end }} {{- else }} {{- with site.Social.twitter }} {{- $twitterSite = . }} @@ -40,5 +42,9 @@ {{- end }} {{- with $twitterSite }} - + {{- $content := . }} + {{- if not (strings.HasPrefix . "@") }} + {{- $content = printf "@%v" $twitterSite }} + {{- end }} + {{- end }}