Repository: gohugoio/hugo (language: go)

Issue:
Regression in embedded templates social deprecation

The opengraph and twitter_cards template adjustments didn't consider this  case:

```text
[[params.social]]
key = 'val'

[[params.social]]
key = 'val'
```




Discussion / hints:

Fix patch:
diff --git a/tpl/tplimpl/embedded/templates/opengraph.html b/tpl/tplimpl/embedded/templates/opengraph.html
index f5a4ebd9f9d..f62ff474e77 100644
--- a/tpl/tplimpl/embedded/templates/opengraph.html
+++ b/tpl/tplimpl/embedded/templates/opengraph.html
@@ -44,8 +44,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/tpl/tplimpl/embedded/templates/twitter_cards.html b/tpl/tplimpl/embedded/templates/twitter_cards.html
index 4a753bba6df..f9f6f10b08e 100644
--- a/tpl/tplimpl/embedded/templates/twitter_cards.html
+++ b/tpl/tplimpl/embedded/templates/twitter_cards.html
@@ -22,8 +22,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 = . }}
@@ -32,5 +34,9 @@
 {{- end }}
 
 {{- with $twitterSite }}
-<meta name="twitter:site" content="@{{ . }}"/>
+  {{- $content := . }}
+  {{- if not (strings.HasPrefix . "@") }}
+    {{- $content = printf "@%v" $twitterSite }}
+  {{- end }}
+<meta name="twitter:site" content="{{ $content }}"/>
 {{- end }}


Test patch: