commit b0114b9bef7132494666aa4e7ee11276f11d6452 parent 9cf14ffebc77797e14fce0a032fd5bb3189761cf Author: David Eisinger <[email protected]> Date: Thu, 9 Jan 2025 21:38:46 -0500 Filter posts by date Diffstat:
| M | themes/v2/layouts/archive/single.html | | | 14 | +++++++++++--- |
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/themes/v2/layouts/archive/single.html b/themes/v2/layouts/archive/single.html @@ -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>