From 8132f5172d286ef73f5d0f2cfbd95da713870484 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Wed, 30 Dec 2020 09:55:37 +0100 Subject: Fixed finding subpages in some cases, use multiple sorted arrays for categories --- scripts/build_content.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/build_content.sh b/scripts/build_content.sh index fc5ddea..78857b5 100755 --- a/scripts/build_content.sh +++ b/scripts/build_content.sh @@ -67,7 +67,8 @@ get_section() { get_subpages_basedir() { filename=$1 - if [ "${filename##*/}" = "index.md" ]; then + filename=${filename%.md} + if [ "${filename##*/}" = "index" ]; then filename=$(dirname "$filename") fi echo "$filename" @@ -165,7 +166,7 @@ get_subpages_meta() { | .by_year |= (to_entries | sort_by(.key) | reverse \ | .[].value |= (sort_by(.date) | reverse))") - categories=$(echo "$categories" | jq ". | to_entries | sort_by(.key)") + categories=$(echo "$categories" | jq ". | to_entries | { by_id: (. | sort_by(.key)), by_count: (. | sort_by(.value.count) | reverse) }") echo "{}" | jq ". + { \ pages: $pages, \ -- cgit v1.2.3-70-g09d2