Get blog and photos posts recursively in the latest widget

Now that year sections are real sections, real pages (i.e. blog posts and photos)
need to be fetched recursively.
This commit is contained in:
Eryn Wells 2024-10-26 08:30:44 -06:00
parent 0e2c7c2dac
commit e65a680b49

View file

@ -1,16 +1,16 @@
{{- $blogSection := site.GetPage "blog" -}}
{{- $latestBlogPosts := $blogSection.Pages.ByDate.Reverse.Limit 2 -}}
{{- $latestBlogPosts := $blogSection.RegularPagesRecursive.ByDate.Reverse.Limit 2 -}}
{{- $photosSection := site.GetPage "photos" -}}
{{- $latestPhotoPosts := $photosSection.Pages.ByDate.Reverse.Limit 1 -}}
{{- $latestPhotoPosts := $photosSection.RegularPagesRecursive.ByDate.Reverse.Limit 4 -}}
<div class="home-latest">
{{ range $latestBlogPosts }}
{{ range $latestBlogPosts -}}
<div class="home-latest__blog">
{{ .Render "page_summary" }}
</div>
{{ end }}
{{ range $latestPhotoPosts }}
{{ range $latestPhotoPosts -}}
<div class="home-latest__photo">
{{ .Render "page_summary" }}
</div>