2020-02-26 06:00:39 -05:00
<!-- https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/twitter_cards.html -->
{{- with $.Params.images -}}
2023-01-20 13:18:47 -05:00
< meta name = "twitter:card" content = "summary_large_image" >
< meta name = "twitter:image" content = "{{ index . 0 | absURL }}" >
2020-02-26 06:00:39 -05:00
{{ else -}}
{{- $images := $.Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- with $featured -}}
2023-01-20 13:18:47 -05:00
< meta name = "twitter:card" content = "summary_large_image" >
< meta name = "twitter:image" content = "{{ $featured.Permalink }}" >
2020-02-26 06:00:39 -05:00
{{- else -}}
{{- with $.Site.Params.images -}}
2023-01-20 13:18:47 -05:00
< meta name = "twitter:card" content = "summary_large_image" >
< meta name = "twitter:image" content = "{{ index . 0 | absURL }}" >
2020-02-26 06:00:39 -05:00
{{ else -}}
2023-01-20 13:18:47 -05:00
< meta name = "twitter:card" content = "summary" >
< meta name = "twitter:image" content = "{{ .Site.BaseURL }}img/{{ .Site.Params.avatar }}" >
2020-02-26 06:00:39 -05:00
{{- end -}}
{{- end -}}
{{- end }}
2023-01-20 13:18:47 -05:00
< 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 -}}" >
2020-02-26 06:00:39 -05:00
{{ with .Site.Social.twitter -}}
2023-01-20 13:18:47 -05:00
< meta name = "twitter:site" content = "@{{ . }}" >
2020-02-26 06:00:39 -05:00
{{ end -}}
{{ range .Site.Authors }}
{{ with .twitter -}}
2023-01-20 13:18:47 -05:00
< meta name = "twitter:creator" content = "@{{ . }}" >
2020-02-26 06:00:39 -05:00
{{ end -}}
{{ end -}}