From 5207ecca453b2951ef7abb4a80070d1b7c9ab215 Mon Sep 17 00:00:00 2001 From: desmukh Date: Tue, 27 Dec 2022 12:01:50 +0500 Subject: [PATCH] writing: new partial to filter essays by year --- layouts/partials/essay-accordion.html | 6 ++++++ layouts/writing/list.html | 17 ++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 layouts/partials/essay-accordion.html diff --git a/layouts/partials/essay-accordion.html b/layouts/partials/essay-accordion.html new file mode 100644 index 0000000..93ebe8a --- /dev/null +++ b/layouts/partials/essay-accordion.html @@ -0,0 +1,6 @@ +

{{ .year }}

+{{ range where .essays "year" .year }} +
+

{{ .year }}. {{ .title }}, {{ .publication }}, {{ .date }}.

+
+{{ end }} \ No newline at end of file diff --git a/layouts/writing/list.html b/layouts/writing/list.html index ca179e0..625b344 100644 --- a/layouts/writing/list.html +++ b/layouts/writing/list.html @@ -2,12 +2,19 @@
-
ESSAYS
- {{ range .Params.Essays }} -
-

{{ .year }}. {{ .title }}, {{ .publication }}, {{ .date }}.

+
+
+
ESSAYS
- {{ end }} +
+ {{ partial "essay-accordion" (dict "essays" .Params.Essays "year" 2022)}} + {{ partial "essay-accordion" (dict "essays" .Params.Essays "year" 2021)}} + {{ partial "essay-accordion" (dict "essays" .Params.Essays "year" 2020)}} + {{ partial "essay-accordion" (dict "essays" .Params.Essays "year" 2019)}} + {{ partial "essay-accordion" (dict "essays" .Params.Essays "year" 2018)}} + {{ partial "essay-accordion" (dict "essays" .Params.Essays "year" 2017)}} +
+
BOOKS