Filter posts by date
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user