From 2a9ce387a57100306149ae1998b1c9b0e6871678 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Mon, 28 Dec 2020 18:29:55 +0100 Subject: Export pages grouped by year as array instead of object --- scripts/build_content.sh | 3 ++- templates/pagelistByYear.html | 17 ++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/build_content.sh b/scripts/build_content.sh index feb3c0d..cf0128b 100755 --- a/scripts/build_content.sh +++ b/scripts/build_content.sh @@ -101,7 +101,8 @@ get_subpages() { collected_metadata=$(echo "$collected_metadata" \ | jq ".all |= (sort_by(.date) | reverse)" \ - | jq ".by_year[] |= (sort_by(.date) | reverse)") + | jq ".by_year[] |= (sort_by(.date) | reverse)" \ + | jq ".by_year |= (to_entries | sort_by(.key) | reverse)") echo "{ \"pages\": $collected_metadata }" | jq . fi diff --git a/templates/pagelistByYear.html b/templates/pagelistByYear.html index 758d45b..972bacc 100644 --- a/templates/pagelistByYear.html +++ b/templates/pagelistByYear.html @@ -1,12 +1,11 @@ $for(pages)$ - $for(it.by_year/pairs)$ -

$it.key$

- +$for(it.by_year)$ + +$endfor$ $endfor$ -- cgit v1.2.3-70-g09d2