Exclude drafts from the latest widget

This commit is contained in:
Eryn Wells 2024-10-27 10:05:35 -06:00
parent e72f8136ab
commit 6343452a62

View file

@ -1,8 +1,8 @@
{{- $blogSection := site.GetPage "blog" -}}
{{- $latestBlogPosts := $blogSection.RegularPagesRecursive.ByDate.Reverse.Limit 2 -}}
{{- $latestBlogPosts := (where $blogSection.RegularPagesRecursive "Draft" "eq" false).ByDate.Reverse.Limit 2 -}}
{{- $photosSection := site.GetPage "photos" -}}
{{- $latestPhotoPosts := $photosSection.RegularPagesRecursive.ByDate.Reverse.Limit 4 -}}
{{- $latestPhotoPosts := (where $photosSection.RegularPagesRecursive "Draft" "eq" false).ByDate.Reverse.Limit 4 -}}
<div class="home-latest">
{{ range $latestBlogPosts -}}