summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build_content.sh5
1 files changed, 3 insertions, 2 deletions
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() {
67 67
68get_subpages_basedir() { 68get_subpages_basedir() {
69 filename=$1 69 filename=$1
70 if [ "${filename##*/}" = "index.md" ]; then 70 filename=${filename%.md}
71 if [ "${filename##*/}" = "index" ]; then
71 filename=$(dirname "$filename") 72 filename=$(dirname "$filename")
72 fi 73 fi
73 echo "$filename" 74 echo "$filename"
@@ -165,7 +166,7 @@ get_subpages_meta() {
165 | .by_year |= (to_entries | sort_by(.key) | reverse \ 166 | .by_year |= (to_entries | sort_by(.key) | reverse \
166 | .[].value |= (sort_by(.date) | reverse))") 167 | .[].value |= (sort_by(.date) | reverse))")
167 168
168 categories=$(echo "$categories" | jq ". | to_entries | sort_by(.key)") 169 categories=$(echo "$categories" | jq ". | to_entries | { by_id: (. | sort_by(.key)), by_count: (. | sort_by(.value.count) | reverse) }")
169 170
170 echo "{}" | jq ". + { \ 171 echo "{}" | jq ". + { \
171 pages: $pages, \ 172 pages: $pages, \