{{- /* 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 -}} {{ $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.*" -}} {{- $avSrc := "" -}} {{- with $avRes }}{{ $avSrc = .RelPermalink }}{{ else }}{{ with $.Params.avatar }}{{ $avSrc = . }}{{ end }}{{ end -}} {{- with $avSrc -}} {{ $authorPage.Params.name | default $authorPage.Title }} {{- end -}} {{ .Params.name | default .Title }} {{- end -}} {{- end -}}