Ajoutes les prochaine date sur la page d'accueil

This commit is contained in:
2024-02-14 13:42:19 +01:00
parent 0bc592530b
commit db040050c4

View File

@@ -28,7 +28,7 @@
{{ if isset .Site.Params "showpostsonhomepage" }}
<div class="home-posts list-posts">
<h2>{{ .Site.Params.ShowPostsOnHomePage | humanize }} Posts</h2>
<h2>Prochaines Dates</h2>
{{ $posts := where .Site.Pages "Params.type" "post" }}
@@ -40,7 +40,14 @@
{{ range $posts.ByDate.Reverse | first 4 }}
{{- partial "list-posts.html" . -}}
{{ end }}
{{ else if eq .Site.Params.ShowPostsOnHomePage "future" }}
{{ range $posts.ByDate }}
{{ if ge .Params.Date.Unix now.Unix }}
{{- partial "list-posts.html" . -}}
{{ end }}
{{ end }}
{{ end }}
</div>
{{ end }}