2024-04-27 14:38:19 +02:00
|
|
|
{{- /* based on Hugo 0.125.5 twitter_cards.html */}}
|
2024-04-07 15:03:50 +02:00
|
|
|
{{- $images := partial "_funcs/get-page-images" . }}
|
|
|
|
{{- with index $images 0 }}
|
2023-10-11 17:31:27 +02:00
|
|
|
<meta name="twitter:card" content="summary_large_image">
|
2024-04-07 15:03:50 +02:00
|
|
|
<meta name="twitter:image" content="{{ .Permalink }}">
|
2023-10-11 17:31:27 +02:00
|
|
|
{{- else }}
|
|
|
|
<meta name="twitter:card" content="summary">
|
|
|
|
{{- end }}
|
2024-04-27 14:38:19 +02:00
|
|
|
|
2024-08-29 12:28:34 +02:00
|
|
|
{{- with partial "title.gotmpl" (dict "page" . "fullyQualified" true "reverse" true) | plainify }}
|
2024-04-27 14:38:19 +02:00
|
|
|
<meta name="twitter:title" content="{{ . }}">
|
|
|
|
{{- end }}
|
|
|
|
|
2024-08-27 15:35:48 +02:00
|
|
|
{{- with trim (or .Description .Summary | plainify | htmlUnescape) "\n\r\t " }}
|
2024-04-27 14:38:19 +02:00
|
|
|
<meta name="twitter:description" content="{{ . }}">
|
|
|
|
{{- end }}
|
2023-10-20 19:50:14 +02:00
|
|
|
|
|
|
|
{{- $twitterSite := "" }}
|
2024-04-22 22:43:59 +02:00
|
|
|
{{- with site.Params.social }}
|
|
|
|
{{- if reflect.IsMap . }}
|
|
|
|
{{- with .twitter }}
|
|
|
|
{{- $content := . }}
|
|
|
|
{{- if not (strings.HasPrefix . "@") }}
|
|
|
|
{{- $content = printf "@%v" . }}
|
|
|
|
{{- end }}
|
|
|
|
<meta name="twitter:site" content="{{ $content }}"/>
|
2023-10-20 20:18:27 +02:00
|
|
|
{{- end }}
|
2023-10-20 19:50:14 +02:00
|
|
|
{{- end }}
|
2023-10-11 17:31:27 +02:00
|
|
|
{{- end }}
|