2024-04-27 12:38:19 +00:00
|
|
|
{{- /* based on Hugo 0.125.5 twitter_cards.html */}}
|
2024-04-07 13:03:50 +00:00
|
|
|
{{- $images := partial "_funcs/get-page-images" . }}
|
|
|
|
{{- with index $images 0 }}
|
2023-10-11 15:31:27 +00:00
|
|
|
<meta name="twitter:card" content="summary_large_image">
|
2024-04-07 13:03:50 +00:00
|
|
|
<meta name="twitter:image" content="{{ .Permalink }}">
|
2023-10-11 15:31:27 +00:00
|
|
|
{{- else }}
|
|
|
|
<meta name="twitter:card" content="summary">
|
|
|
|
{{- end }}
|
2024-04-27 12:38:19 +00:00
|
|
|
|
|
|
|
{{- with partial "pageHelper/title.hugo" (dict "page" . "fullyQualified" true "reverse" true) | plainify }}
|
|
|
|
<meta name="twitter:title" content="{{ . }}">
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{- with or .Description .Summary | plainify | htmlUnescape | chomp }}
|
|
|
|
<meta name="twitter:description" content="{{ . }}">
|
|
|
|
{{- end }}
|
2023-10-20 17:50:14 +00:00
|
|
|
|
|
|
|
{{- $twitterSite := "" }}
|
2024-04-22 20:43:59 +00: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 18:18:27 +00:00
|
|
|
{{- end }}
|
2023-10-20 17:50:14 +00:00
|
|
|
{{- end }}
|
2023-10-11 15:31:27 +00:00
|
|
|
{{- end }}
|