{{ $page := . -}} {{- $coverPath := .Params.cover -}} {{- $img := false -}} {{- if $coverPath -}} {{- $coverResourcePath := (urls.Parse $coverPath).Path -}} {{- if ne $coverResourcePath "" -}} {{- $coverPathLower := lower $coverResourcePath -}} {{- if or (strings.HasSuffix $coverPathLower ".yaml") (strings.HasSuffix $coverPathLower ".yml") -}} {{- $coverDataFile := $page.Resources.Get $coverResourcePath -}} {{- if $coverDataFile -}} {{- with $coverDataFile.Content | transform.Unmarshal -}} {{- with index . "file" -}} {{- $coverFilePath := strings.TrimSpace (printf "%v" .) -}} {{- if ne $coverFilePath "" -}} {{- $img = $page.Resources.Get $coverFilePath -}} {{- end -}} {{- end -}} {{- end -}} {{- end -}} {{- else -}} {{- $img = $page.Resources.Get $coverResourcePath -}} {{- end -}} {{- end -}} {{- end -}} {{- if $img -}} {{- with $img -}} {{- $resized := .Fill "450x220" -}}
{{ end -}} {{ else }}
{{ end -}}
{{ index .Params.dossier 0 }}

{{ .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 }}