2020-11-09 12:36:28 +01:00
|
|
|
{{ define "main" }}
|
|
|
|
<div class="container">
|
2024-04-02 23:18:38 +02:00
|
|
|
{{ $headless := site.GetPage "/" }}
|
2024-05-07 16:41:34 +02:00
|
|
|
{{ $widthOriginal := 1920 }}
|
|
|
|
{{ $heightOriginal := 850 }}
|
|
|
|
{{ $width := 1208 }}
|
|
|
|
{{ $height := 534 }}
|
2024-04-02 23:18:38 +02:00
|
|
|
{{ $image := default ($headless.Resources.GetMatch "**.jpg") (.Resources.GetMatch (default "**.jpg" .Params.image)) }}
|
|
|
|
{{ if $image }}
|
2024-05-07 16:41:34 +02:00
|
|
|
{{ if and (ge $image.Width $widthOriginal) (ge $image.Height $heightOriginal) }}
|
|
|
|
{{ $image = $image.Process (printf "fill %dx%d Center webp" $width $height) }}
|
|
|
|
{{ else if gt $image.Height $height }}
|
|
|
|
{{ $image = $image.Process (printf "resize x%d webp" $height) }}
|
|
|
|
{{ else }}
|
|
|
|
{{ $image = $image.Process "webp" }}
|
|
|
|
{{ end }}
|
2024-04-02 23:18:38 +02:00
|
|
|
<img
|
|
|
|
class="hero no-print"
|
2024-05-07 16:41:34 +02:00
|
|
|
src="{{ $image.RelPermalink }}"
|
2024-04-02 23:18:38 +02:00
|
|
|
alt="{{ or .Params.image_ .Params.image_credit }}"
|
|
|
|
title="{{ or .Params.image_ .Params.image_credit }}"
|
|
|
|
/>
|
|
|
|
{{ end }}
|
2020-11-09 12:36:28 +01:00
|
|
|
<h1>{{ .RenderString .Title }}</h1>
|
2020-11-23 11:31:02 +01:00
|
|
|
<div class="container news md">
|
2020-11-25 18:00:03 +01:00
|
|
|
<small>
|
2022-04-19 23:52:32 +02:00
|
|
|
Publié le <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>
|
2020-11-09 12:36:28 +01:00
|
|
|
{{ .Content }}
|
2020-11-25 18:00:03 +01:00
|
|
|
<aside>
|
|
|
|
<hr>
|
|
|
|
<h2>
|
|
|
|
{{ if and .NextInSection .PrevInSection }}
|
2020-12-05 10:02:05 +01:00
|
|
|
Les actualités suivantes et précédentes
|
2020-11-25 18:00:03 +01:00
|
|
|
{{ else if .NextInSection }}
|
2020-12-05 10:02:05 +01:00
|
|
|
L'actualité précédente
|
2020-11-25 18:00:03 +01:00
|
|
|
{{ else }}
|
2020-12-05 10:02:05 +01:00
|
|
|
L'actualité suivante
|
2020-11-25 18:00:03 +01:00
|
|
|
{{ end }}
|
|
|
|
</h2>
|
|
|
|
{{ with .NextInSection }}
|
|
|
|
{{ .Scratch.Set "big" false }}
|
|
|
|
{{ partial "article-preview.html" . }}
|
|
|
|
{{ end }}
|
|
|
|
{{ with .PrevInSection }}
|
|
|
|
{{ .Scratch.Set "big" false }}
|
|
|
|
{{ partial "article-preview.html" . }}
|
|
|
|
{{ end }}
|
|
|
|
</aside>
|
2020-11-09 12:36:28 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{ end }}
|