2021-12-30 14:30:40 +00:00
|
|
|
{{- with $.Params.images -}}
|
2021-12-30 14:55:55 +00:00
|
|
|
<meta name="twitter:card" content="summary_large_image" />
|
|
|
|
<meta name="twitter:image" content="{{ index . 0 | absURL }}" />
|
2022-02-06 15:59:16 +00:00
|
|
|
{{- else }}
|
2021-12-30 14:55:55 +00:00
|
|
|
{{- $images := $.Resources.ByType "image" -}}
|
|
|
|
{{- $featured := $images.GetMatch "*feature*" -}}
|
2022-02-06 15:59:16 +00:00
|
|
|
{{- if not $featured }}
|
|
|
|
{{- $featured = $images.GetMatch "{*cover*,*thumbnail*}" -}}
|
|
|
|
{{- end }}
|
|
|
|
{{- with $featured }}
|
2021-12-30 14:55:55 +00:00
|
|
|
<meta name="twitter:card" content="summary_large_image" />
|
|
|
|
<meta name="twitter:image" content="{{ $featured.Permalink }}" />
|
2022-02-06 15:59:16 +00:00
|
|
|
{{- else }}
|
|
|
|
{{- with $.Site.Params.images }}
|
2021-12-30 14:55:55 +00:00
|
|
|
<meta name="twitter:card" content="summary_large_image" />
|
|
|
|
<meta name="twitter:image" content="{{ index . 0 | absURL }}" />
|
2022-02-06 15:59:16 +00:00
|
|
|
{{- else }}
|
2021-12-30 14:55:55 +00:00
|
|
|
<meta name="twitter:card" content="summary" />
|
2022-02-06 15:59:16 +00:00
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
2021-12-30 14:30:40 +00:00
|
|
|
{{- end }}
|
2022-02-06 11:46:10 +00:00
|
|
|
<meta name="twitter:title" content="{{ partial "utils/title" . }}" />
|
2022-02-05 19:02:17 +00:00
|
|
|
{{- with partial "utils/description" . }}
|
2022-02-07 13:47:30 +00:00
|
|
|
<meta name="twitter:description" content="{{ trim (. | plainify) "\n" | safeHTML }}" />
|
2022-02-05 19:02:17 +00:00
|
|
|
{{- end }}
|
|
|
|
{{- with .Site.Social.twitter -}}
|
2021-12-30 14:55:55 +00:00
|
|
|
<meta name="twitter:site" content="@{{ . }}" />
|
2022-02-05 19:02:17 +00:00
|
|
|
{{- end }}
|