diff options
Diffstat (limited to 'tpl/tplimpl/embedded/templates/twitter_cards.html')
-rw-r--r-- | tpl/tplimpl/embedded/templates/twitter_cards.html | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/tpl/tplimpl/embedded/templates/twitter_cards.html b/tpl/tplimpl/embedded/templates/twitter_cards.html index e66a5029a..c445efdfc 100644 --- a/tpl/tplimpl/embedded/templates/twitter_cards.html +++ b/tpl/tplimpl/embedded/templates/twitter_cards.html @@ -8,23 +8,15 @@ <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 -}}"/> -{{- /* Deprecate site.Social.twitter in favor of site.Params.social.twitter */}} {{- $twitterSite := "" }} {{- with site.Params.social }} {{- if reflect.IsMap . }} - {{- $twitterSite = .twitter }} + {{- with .twitter }} + {{- $content := . }} + {{- if not (strings.HasPrefix . "@") }} + {{- $content = printf "@%v" . }} + {{- end }} + <meta name="twitter:site" content="{{ $content }}"/> + {{- end }} {{- end }} -{{- else }} - {{- with site.Social.twitter }} - {{- $twitterSite = . }} - {{- warnf "The social key in site configuration is deprecated. Use params.social.twitter instead." }} - {{- end }} -{{- end }} - -{{- with $twitterSite }} - {{- $content := . }} - {{- if not (strings.HasPrefix . "@") }} - {{- $content = printf "@%v" $twitterSite }} - {{- end }} -<meta name="twitter:site" content="{{ $content }}"/> {{- end }} |