Filter posts by date

This commit is contained in:
David Eisinger
2025-01-09 21:38:46 -05:00
parent 9cf14ffebc
commit b0114b9bef

View File

@@ -1,11 +1,19 @@
{{ define "main" }}
{{ $sd := .Params.start_date }}
{{ $ed := .Params.end_date }}
<section class="page-break">
{{ time.Format "January 2006" .Params.start_date }}
{{ time.Format "January 2006" .Params.end_date}}
{{ time.Format "January 2006" $sd }} {{ time.Format "January 2006" $ed }}
</section>
{{ range (sort (.Site.RegularPages.RelatedTo (keyVals "tags" "dispatch")) "Date" "asc") }}
{{ $page := . }}
{{ if lt (time.Format "2006-01-02" .Date) (time.Format "2006-01-02" $sd) }}
{{ continue }}
{{ end }}
{{ if gt (time.Format "2006-01-02" .Date) (time.Format "2006-01-02" $ed) }}
{{ continue }}
{{ end }}
<section class="page-break">
<h2>