2024-04-22 20:43:59 +00:00
{{- /* based on Hugo 0.125.3 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-07 20:13:52 +00:00
< meta name = "twitter:title" content = "{{ partial " pageHelper / title . hugo " ( dict " page " . " fullyQualified " true " reverse " true ) } } " >
2023-10-11 15:31:27 +00:00
< meta name = "twitter:description" content = "{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ 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 }}