{{ $page := . -}} {{- $coverPath := .Params.cover -}} {{- $img := false -}} {{- if $coverPath -}} {{- if strings.HasSuffix $coverPath ".yaml" -}} {{- $coverAbsPath := printf "%s%s" $page.File.Dir $coverPath -}} {{- $coverRaw := readFile $coverAbsPath -}} {{- $coverData := $coverRaw | transform.Unmarshal -}} {{- with $coverData.file -}} {{- $img = $page.Resources.GetMatch . -}} {{- end -}} {{- else -}} {{- $img = $page.Resources.GetMatch $coverPath -}} {{- end -}} {{- end -}} {{- if $img -}} {{- with $img -}} {{- $resized := .Fill "450x220" -}}
{{ end -}} {{ else }}
{{ end -}}

{{ .Title }}

{{- if not $page.IsSection -}} {{- with $page.Date -}} {{- end -}} {{- end -}}
{{ $section := "" -}} {{- with .Parent -}} {{- $sectionPath := path.Base .File.Dir -}} {{- $section = $sectionPath -}} {{- end -}} {{ .Parent.LinkTitle }} {{ if .IsSection -}} {{- $count := len .Pages -}} {{- $label := cond (eq $count 1) "article" "articles" -}} {{- $count }} {{ $label -}} {{- else -}} {{- if ge .ReadingTime 5 -}} {{- .ReadingTime }} min de lecture {{- end -}} {{- end }}