github.com/neohugo/neohugo@v0.123.8/tpl/tplimpl/embedded/templates/twitter_cards.html (about) 1 {{- $images := partial "_funcs/get-page-images" . -}} 2 {{- with index $images 0 -}} 3 <meta name="twitter:card" content="summary_large_image" /> 4 <meta name="twitter:image" content="{{ .Permalink }}" /> 5 {{- else -}} 6 <meta name="twitter:card" content="summary"/> 7 {{- end -}} 8 <meta name="twitter:title" content="{{ .Title }}"/> 9 <meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"/> 10 11 {{- /* Deprecate site.Social.twitter in favor of site.Params.social.twitter */}} 12 {{- $twitterSite := "" }} 13 {{- with site.Params.social }} 14 {{- if reflect.IsMap . }} 15 {{- $twitterSite = .twitter }} 16 {{- end }} 17 {{- else }} 18 {{- with site.Social.twitter }} 19 {{- $twitterSite = . }} 20 {{- warnf "The social key in site configuration is deprecated. Use params.social.twitter instead." }} 21 {{- end }} 22 {{- end }} 23 24 {{- with $twitterSite }} 25 {{- $content := . }} 26 {{- if not (strings.HasPrefix . "@") }} 27 {{- $content = printf "@%v" $twitterSite }} 28 {{- end }} 29 <meta name="twitter:site" content="{{ $content }}"/> 30 {{- end }}