summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2021-04-18 15:44:32 +0200
committerVolpeon <git@volpeon.ink>2021-04-18 15:44:32 +0200
commit8c83a2ef92be845c5ffecb1434028d0c68915936 (patch)
treea18faff703a1deadb041dcc977208a4d6565dd85 /scripts
parentFetch pages of sections (diff)
downloadvolpeon.ink-8c83a2ef92be845c5ffecb1434028d0c68915936.tar.gz
volpeon.ink-8c83a2ef92be845c5ffecb1434028d0c68915936.tar.bz2
volpeon.ink-8c83a2ef92be845c5ffecb1434028d0c68915936.zip
Update
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build_content.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/build_content.sh b/scripts/build_content.sh
index c20eca8..83b6908 100755
--- a/scripts/build_content.sh
+++ b/scripts/build_content.sh
@@ -69,10 +69,10 @@ get_subpages_metadata() {
69 fi 69 fi
70 70
71 local pages="[]" 71 local pages="[]"
72 local sections="{}" 72 local subsections="{}"
73 73
74 for file_in in "${child_pages[@]}"; do 74 for file_in in "${child_pages[@]}"; do
75 local section=$(basename "${file_in%/index.md}") 75 local subsection=$(basename "${file_in%/index.md}")
76 local content=$(get_content "$file_in" | sed -z 's/\\/\\\\/g;s/\n/\\n/g;s/"/\\"/g') 76 local content=$(get_content "$file_in" | sed -z 's/\\/\\\\/g;s/\n/\\n/g;s/"/\\"/g')
77 local metadata=$(get_metadata "$file_in" | jq "{ \ 77 local metadata=$(get_metadata "$file_in" | jq "{ \
78 file_out: .file_out, \ 78 file_out: .file_out, \
@@ -92,10 +92,10 @@ get_subpages_metadata() {
92 fi 92 fi
93 93
94 pages=$(echo "$pages" | jq ". += [ $metadata ]") 94 pages=$(echo "$pages" | jq ". += [ $metadata ]")
95 sections=$(echo "$sections" | jq ". += { \"$section\": { title: $title, pages: $subpages } }") 95 subsections=$(echo "$subsections" | jq ". += { \"$subsection\": { title: $title, pages: $subpages } }")
96 done 96 done
97 97
98 echo "{ \"pages\": $pages, \"sections\": $sections }" 98 echo "{ \"pages\": $pages, \"subsections\": $subsections }"
99} 99}
100 100
101handle () { 101handle () {