2020-11-25 18:00:03 +01:00
|
|
|
{{ $isBig := default false (.Scratch.Get "big") }}
|
|
|
|
{{ $title := .RenderString .Title }}
|
|
|
|
{{ $titleWithoutHTML := $title | plainify }}
|
|
|
|
{{ $pictureSize := cond $isBig "220x220 Center" "100x100 Center" }}
|
|
|
|
{{ $truncateSize := cond $isBig 180 90}}
|
|
|
|
<div class="post{{ if $isBig }} big{{ end }}">
|
|
|
|
<div class="picture">
|
|
|
|
{{ $image := .Resources.GetMatch (default "*" .Params.image) }}
|
|
|
|
<a href="{{ .RelPermalink }}">
|
|
|
|
{{ if $image }}
|
|
|
|
{{ $resized := $image.Fill $pictureSize}}
|
|
|
|
<img src="{{ $resized.RelPermalink }}" alt="{{ $titleWithoutHTML }}" />
|
|
|
|
{{ end }}
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div class="details">
|
|
|
|
<small>
|
2020-12-22 17:01:24 +01:00
|
|
|
<time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Day }} {{ index $.Site.Data.mois (printf "%d" .Date.Month) }} {{ .Date.Year }}</time>{{ if isset .Params "auteur" }} - {{ .Params.auteur }}{{ 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>
|