{{- $page := . -}} {{- $showSection := true -}} {{- $linkSection := true -}} {{- $showMeta := true -}} {{- $showDossierBeforeTitle := false -}} {{- $showInterestingLinksMeta := false -}} {{- $thumbnailSize := "large" -}} {{- $externalLinksReport := dict -}} {{- if reflect.IsMap . -}} {{- if isset . "Page" -}} {{- $page = index . "Page" -}} {{- end -}} {{- if isset . "ShowSection" -}} {{- $showSection = index . "ShowSection" -}} {{- end -}} {{- if isset . "LinkSection" -}} {{- $linkSection = index . "LinkSection" -}} {{- end -}} {{- if isset . "ShowMeta" -}} {{- $showMeta = index . "ShowMeta" -}} {{- end -}} {{- if isset . "ShowDossierBeforeTitle" -}} {{- $showDossierBeforeTitle = index . "ShowDossierBeforeTitle" -}} {{- end -}} {{- if isset . "ShowInterestingLinksMeta" -}} {{- $showInterestingLinksMeta = index . "ShowInterestingLinksMeta" -}} {{- end -}} {{- if isset . "ThumbnailSize" -}} {{- $thumbnailSize = index . "ThumbnailSize" -}} {{- end -}} {{- if isset . "ExternalLinksReport" -}} {{- $externalLinksReport = index . "ExternalLinksReport" -}} {{- end -}} {{- end -}} {{- $thumbnailTransform := "700x394" -}} {{- if eq $thumbnailSize "small" -}} {{- $thumbnailTransform = "340x191" -}} {{- else if eq $thumbnailSize "spotlight" -}} {{- $thumbnailTransform = "900x506" -}} {{- end -}} {{- $thumbnailOptions := printf "%s webp q80" $thumbnailTransform -}} {{- $coverPath := $page.Params.cover -}} {{- $image := 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 -}} {{- $image = $page.Resources.GetMatch . -}} {{- end -}} {{- else -}} {{- $image = $page.Resources.GetMatch $coverPath -}} {{- end -}} {{- end -}} {{- $dossierTitle := "" -}} {{- $dossierFirstPage := false -}} {{- with $page.Params.dossier -}} {{- with index . 0 -}} {{- $dossierTitle = . -}} {{- if $showDossierBeforeTitle -}} {{- $dossierFirstPage = partial "dossier-first-page.html" $page -}} {{- end -}} {{- end -}} {{- end -}} {{- $originLink := "" -}} {{- $originHost := "" -}} {{- $statusTone := "unknown" -}} {{- $statusLabel := "État inconnu" -}} {{- $statusTitle := "" -}} {{- $statusChecked := "" -}} {{- if and $showMeta $showInterestingLinksMeta -}} {{- with $page.Params.links -}} {{- range . -}} {{- if and (eq $originLink "") (not .archive) -}} {{- with .url -}} {{- $originLink = . -}} {{- end -}} {{- end -}} {{- end -}} {{- end -}} {{- with partial "external-link-status.html" (dict "URL" $originLink "Report" $externalLinksReport) -}} {{- with index . "Host" -}} {{- $originHost = . -}} {{- end -}} {{- with index . "Tone" -}} {{- $statusTone = . -}} {{- end -}} {{- with index . "Label" -}} {{- $statusLabel = . -}} {{- end -}} {{- with index . "Title" -}} {{- $statusTitle = . -}} {{- end -}} {{- with index . "CheckedAt" -}} {{- $statusChecked = . -}} {{- end -}} {{- end -}} {{- end -}}
{{- if $showDossierBeforeTitle -}}
{{- with $image -}} {{- $resized := .Fill $thumbnailOptions -}} Image de couverture pour {{ $page.Title }} {{- end -}}
{{- with $dossierTitle -}} {{- with $dossierFirstPage -}}

{{ $dossierTitle }}

{{- end -}} {{- end -}}

{{ $page.Title }}

{{- else -}}
{{- with $image -}} {{- $resized := .Fill $thumbnailOptions -}} Image de couverture pour {{ $page.Title }} {{- end -}}

{{ $page.Title }}

{{- end -}} {{- with $page.Summary -}}

{{ . | plainify | truncate 180 }}

{{- end -}} {{- if $showMeta -}} {{- if $showInterestingLinksMeta -}} {{- else -}}

{{- with $page.Date -}} {{- end -}} {{- if $showSection -}} {{- with $page.Parent -}} · {{- if $linkSection -}} {{ with .LinkTitle }}{{ . }}{{ else }}{{ .Title }}{{ end }} {{- else -}} {{ with .LinkTitle }}{{ . }}{{ else }}{{ .Title }}{{ end }} {{- end -}} {{- end -}} {{- end -}} {{- if and (not $showDossierBeforeTitle) $dossierTitle -}} · {{ $dossierTitle }} {{- end -}} {{- if and (not $page.IsSection) (ge $page.ReadingTime 5) -}} · {{ $page.ReadingTime }} min {{- end -}}

{{- end -}} {{- end -}}