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:
parent
0e2c7c2dac
commit
e65a680b49
1 changed files with 4 additions and 4 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue