summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2020-12-30 09:55:37 +0100
committerVolpeon <git@volpeon.ink>2020-12-30 09:55:37 +0100
commit8132f5172d286ef73f5d0f2cfbd95da713870484 (patch)
tree0aa9ae8cee715f4d5d654e8e87fad5662a9e6ce8 /scripts
parentRevert to old category metadata collection, add support for authors (diff)
downloadvolpeon.ink-8132f5172d286ef73f5d0f2cfbd95da713870484.tar.gz
volpeon.ink-8132f5172d286ef73f5d0f2cfbd95da713870484.tar.bz2
volpeon.ink-8132f5172d286ef73f5d0f2cfbd95da713870484.zip
Fixed finding subpages in some cases, use multiple sorted arrays for categories
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, \