1
Fork 0

Sort blog posts by date

This commit is contained in:
Jake Howard 2017-09-11 20:55:50 +01:00
parent d98845cf95
commit 70a31616f8
Signed by: jake
GPG key ID: 57AFB45680EDD477

20
layouts/posts/list.html Normal file
View file

@ -0,0 +1,20 @@
{{ partial "page_start.html" . }}
<section id="main" class="container">
{{ partial "content.html" . }}
{{ if ne .Params.hide_pages "true" }}
<div class="row">
{{ $parent := . }}
{{ $valid_pages := sort .Site.Pages "Date" "desc" }}
{{ $valid_pages := where $valid_pages ".Parent" "!=" nil }}
{{ $valid_pages := where $valid_pages ".Params.hide_in_list" "!=" "true" }}
{{ range where $valid_pages ".Parent.UniqueID" $parent.UniqueID }}
{{ if $parent.Params.show_images }}
{{ partial "box_image.html" . }}
{{ else }}
{{ partial "box.html" . }}
{{ end }}
{{ end }}
</div>
{{ end }}
</section>
{{ partial "page_end.html" . }}