summaryrefslogtreecommitdiffstats
path: root/tpl/tplimpl/embedded/templates/twitter_cards.html
diff options
context:
space:
mode:
Diffstat (limited to 'tpl/tplimpl/embedded/templates/twitter_cards.html')
-rw-r--r--tpl/tplimpl/embedded/templates/twitter_cards.html12
1 files changed, 9 insertions, 3 deletions
diff --git a/tpl/tplimpl/embedded/templates/twitter_cards.html b/tpl/tplimpl/embedded/templates/twitter_cards.html
index 4a753bba6..f9f6f10b0 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 }}