2020-11-25 18:00:03 +01:00
|
|
|
{{ $isBig := default false (.Scratch.Get "big") }}
|
|
|
|
{{ $title := .RenderString .Title }}
|
|
|
|
{{ $titleWithoutHTML := $title | plainify }}
|
2021-05-12 08:43:19 +02:00
|
|
|
{{ $pictureSize := cond $isBig "528x528 Center webp" "100x100 Center webp" }}
|
2020-11-25 18:00:03 +01:00
|
|
|
{{ $truncateSize := cond $isBig 180 90}}
|
|
|
|
<div class="post{{ if $isBig }} big{{ end }}">
|
|
|
|
<div class="picture">
|
2023-05-04 21:20:34 +02:00
|
|
|
{{ $imageName := or .Params.vignette .Params.image }}
|
|
|
|
{{ $image := .Resources.GetMatch (default "**.jpg" $imageName) }}
|
2020-11-25 18:00:03 +01:00
|
|
|
<a href="{{ .RelPermalink }}">
|
|
|
|
{{ if $image }}
|
|
|
|
{{ $resized := $image.Fill $pictureSize}}
|
2021-04-21 10:55:24 +02:00
|
|
|
<img src="{{ $resized.RelPermalink }}" alt="{{ $titleWithoutHTML }}" loading="lazy" />
|
2020-11-25 18:00:03 +01:00
|
|
|
{{ end }}
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div class="details">
|
|
|
|
<small>
|
2024-06-24 17:12:07 +02:00
|
|
|
<time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Day }} {{ index $.Site.Data.mois (printf "%d" .Date.Month) }} {{ .Date.Year }}</time>{{ if or (isset .Params "auteur") (isset .Params "authors") }} - {{ if isset .Params "authors" -}}
|
|
|
|
{{ range $key, $value := .Params.authors }}
|
|
|
|
{{ with site.GetPage $value }}
|
|
|
|
{{ if gt $key 0 }} & {{ end }}
|
|
|
|
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{- end }}{{ if isset .Params "auteur" }}{{ if isset .Params "authors" -}} & {{ end }}{{ .Params.auteur }}{{ end }}{{ end }}
|
2020-11-25 18:00:03 +01:00
|
|
|
</small>
|
|
|
|
{{ if $isBig }}
|
|
|
|
<h2 title="{{ $titleWithoutHTML }}"><a href="{{ .RelPermalink }}">{{ $title }}</a></h2>
|
|
|
|
{{else}}
|
|
|
|
<h3 title="{{ $titleWithoutHTML }}"><a href="{{ .RelPermalink }}">{{ $title }}</a></h3>
|
|
|
|
{{ end }}
|
|
|
|
<div class="text">
|
|
|
|
{{ $ellipsis := print " <a href='" .RelPermalink "'>…</a>" | safeHTML }}
|
2020-11-26 22:20:09 +01:00
|
|
|
{{ (replace (.Content | plainify) "\n" " ") | htmlUnescape | truncate $truncateSize $ellipsis }}
|
2020-11-25 18:00:03 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|