{{- /* Compact post card for grids. Expects a post page as context (.). */ -}} {{- $post := . -}}
{{- $thumb := $post.Resources.GetMatch "banner.png" -}} {{- if not $thumb -}}{{- $thumb = $post.Resources.GetMatch "01.png" -}}{{- end -}}
{{- if $thumb -}} {{- partial "img.html" (dict "res" $thumb "widths" (slice 600 1000) "sizes" "(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 25vw" "class" "w-full h-full object-cover" "alt" $post.Title) -}} {{- else -}}{{- with $post.Params.banner -}} {{- partial "media.html" (dict "media" . "class" "w-full h-full object-cover") -}} {{- else -}}
PIVOINE
{{- end -}}{{- end -}}
{{- with $post.Params.categories -}}
{{- range first 1 . -}} {{ . }} {{- end -}}
{{- end -}}

{{- $post.Title -}}

{{- with $post.Params.author -}} {{- $authorPage := site.GetPage (printf "authors/%s" .) -}} {{- with $authorPage -}} {{- $avRes := .Resources.GetMatch "avatar.*" -}} {{- if $avRes -}} {{- $av := $avRes.Resize "64x webp" -}} {{ $authorPage.Params.name | default $authorPage.Title }} {{- else -}}{{- with .Params.avatar -}} {{ $authorPage.Params.name | default $authorPage.Title }} {{- end -}}{{- end -}} {{ .Params.name | default .Title }} {{- end -}} {{- end -}}