2018-05-04 11:53:56 -04:00
{{- with $.Params.images -}}
< meta name = "twitter:card" content = "summary_large_image" / >
< meta name = "twitter:image" content = "{{ index . 0 | absURL }}" / >
{{ else -}}
{{- $images := $.Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
2019-11-26 14:11:53 -05:00
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
2018-05-04 11:53:56 -04:00
{{- with $featured -}}
< meta name = "twitter:card" content = "summary_large_image" / >
< meta name = "twitter:image" content = "{{ $featured.Permalink }}" / >
{{- else -}}
{{- with $.Site.Params.images -}}
< meta name = "twitter:card" content = "summary_large_image" / >
< meta name = "twitter:image" content = "{{ index . 0 | absURL }}" / >
{{ else -}}
< meta name = "twitter:card" content = "summary" / >
{{- end -}}
{{- end -}}
{{- end }}
< 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 -}}" / >
2023-10-16 20:43:11 -04:00
{{- /* Deprecate site.Social.twitter in favor of site.Params.social.twitter */}}
{{- $twitterSite := "" }}
{{- with site.Params.social.twitter }}
{{- $twitterSite = . }}
{{- else }}
{{- with site.Social.twitter }}
{{- $twitterSite = . }}
{{- warnf "The social key in site configuration is deprecated. Use params.social.twitter instead." }}
{{- end }}
{{- end }}
{{- with $twitterSite }}
2018-05-04 11:53:56 -04:00
< meta name = "twitter:site" content = "@{{ . }}" / >
2023-10-16 20:43:11 -04:00
{{- end }}