cremeaux/layouts/home.html

27 lines
796 B
HTML
Raw Normal View History

2020-11-09 12:36:28 +01:00
{{ define "main" }}
<div class="container">
<h1>Le fil <strong>des actualités</strong></h1>
<div class="infos">
<div class="news">
2021-01-28 21:06:18 +01:00
{{ $headless := .Site.GetPage "/actualites/" }}
2020-11-09 12:36:28 +01:00
{{ $lastnews := first 4 (sort $headless.Pages "Date" "desc") }}
{{ $first := index (first 1 $lastnews) 0 }}
{{ $others := after 1 $lastnews }}
{{ with $first }}
{{ .Scratch.Set "big" true }}
{{ partial "article-preview.html" . }}
2020-11-09 12:36:28 +01:00
{{ end }}
{{ range $others }}
{{ partial "article-preview.html" . }}
2020-11-09 12:36:28 +01:00
{{ end }}
<p>
2021-01-28 21:06:18 +01:00
<a href="/actualites/">Voir toutes les actualités</a>
</p>
2020-11-09 12:36:28 +01:00
</div>
<div class="opening">
{{ .Content }}
</div>
</div>
</div>
{{ end }}