{{- /* -- Based on the Hugo embedded twitter_cards.html partial (v0.167.0). -- -- Changes: the description comes from page-description.html and the image -- from social-image.html (JPEG, 1200 px wide max). */ -}} {{- /* The default image (avatar) is better displayed as a small card. */}} {{- $social := partialCached "social-image.html" . .Permalink }} {{- with $social.image }} {{- else }} {{- end }} {{- with or .Title site.Title site.Params.title | plainify }} {{- end }} {{- with partialCached "page-description.html" . .Permalink }} {{- end }} {{- $twitterSite := "" }} {{- with site.Params.social }} {{- if reflect.IsMap . }} {{- with .twitter }} {{- $content := . }} {{- if not (strings.HasPrefix . "@") }} {{- $content = printf "@%v" . }} {{- end }} {{- end }} {{- end }} {{- end }}