Files
cremeaux/layouts/home.html
Simon C 4ce0a04f96
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing
feat: Ajout des articles mise en avant
2025-03-25 10:56:53 +01:00

60 lines
2.2 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{{ define "main" }}
<div class="container">
{{/* <p class="bandeau">
<a href="/actualites/2023/06/sauvons-la-pharmacie/">Signez</a> pour sauver la pharmacie de Crémeaux ! Nous avons besoin de votre soutien !
</p> */}}
<div class="containerGrid">
<div class="actus">
{{ $actualites := sort (.Site.GetPage "/actualites/").Pages "Date" "desc" }}
<div class="news viemunicipale">
<h1>Le fil des <strong>actualités</strong></h1>
{{ $lastnews := first 4 (where $actualites "Params.event" false) }}
{{ $highlight := first 1 (where $lastnews "Params.highlight" true) }}
{{ if gt (len $highlight) 0 }}
{{ $highlight = index $highlight 0 }}
{{ else }}
{{ $highlight = index $lastnews 0 }}
{{ end }}
{{ $others := where $lastnews "Title" "ne" $highlight.Title }}
{{ with $highlight }}
{{ .Scratch.Set "big" true }}
{{ partial "article-preview.html" . }}
{{ end }}
{{ range $others }}
{{ partial "article-preview.html" . }}
{{ end }}
<p>
<a href="/actualites/">Voir toutes les actualités</a>
</p>
</div>
<div class="news associations">
<h2 class="h1">Le fil des <strong>Évènements</strong></h2>
{{ $lastnews := first 4 (where $actualites "Params.event" true) }}
{{ $highlight := first 1 (where $lastnews "Params.highlight" true) }}
{{ if gt (len $highlight) 0 }}
{{ $highlight = index $highlight 0 }}
{{ else }}
{{ $highlight = index $lastnews 0 }}
{{ end }}
{{ $others := where $lastnews "Title" "ne" $highlight.Title }}
{{ with $highlight }}
{{ .Scratch.Set "big" true }}
{{ partial "article-preview.html" . }}
{{ end }}
{{ range $others }}
{{ partial "article-preview.html" . }}
{{ end }}
<p>
<a href="/actualites/">Voir tous les évènements</a>
</p>
</div>
</div>
<div class="infos">
<div class="opening2">
{{ .Content }}
</div>
</div>
</div>
</div>
{{ end }}