From 1caccddbdfb2c1102be1a1da29f6a03e64695abe Mon Sep 17 00:00:00 2001 From: Volpeon Date: Thu, 31 Dec 2020 21:59:58 +0100 Subject: Revert to old subpage find commands, include page content in feed --- scripts/build_content.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'scripts/build_content.sh') diff --git a/scripts/build_content.sh b/scripts/build_content.sh index 17532f5..4e1b396 100755 --- a/scripts/build_content.sh +++ b/scripts/build_content.sh @@ -85,12 +85,20 @@ get_subpages_meta() { child_pages=() if [ -d "$basedir" ]; then - mapfile -d $'\0' child_pages < <(find $basedir/ \ + mapfile -d $'\0' child_pages_1 < <(find $basedir/ \ -type f \ - -name "*.md" \ - ! -wholename "$basedir/index.md" \ + -name "*.md" ! -name "index.md" \ + -maxdepth 1 \ + -print0) + + mapfile -d $'\0' child_pages_2 < <(find $basedir/ \ + -type f \ + -name "index.md" \ + -mindepth 2 \ -maxdepth 2 \ -print0) + + child_pages=("${child_pages_1[@]}" "${child_pages_2[@]}") fi pages=$(echo "{}" | jq ". + { \ @@ -107,7 +115,7 @@ get_subpages_meta() { #echo -e "\033[0;90m[////////]\033[0m - $file" metadata=$(get_metadata "$file") - # content=$(get_content "$file") + content=$(get_content "$file") section=$(get_section "$file") @@ -140,13 +148,8 @@ get_subpages_meta() { category_name=$(echo "$CATEGORIES" | jq -r .$section.$category) fi - # metadata=$(echo "$metadata" | jq ". + { \ - # content: { \ - # plain: \"$(echo "$content" | sed -z 's/\\/\\\\/g;s/\n/\\n/g;s/"/\"/g')\", \ - # }, \ - # }") - metadata=$(echo "$metadata" | jq ". + { \ + content: \"$(echo "$content" | sed -z 's/\\/\\\\/g;s/\n/\\n/g;s/"/\"/g')\", \ date: { \ yyyy_mm_dd: \"$date\", \ rfc3339: \"$date_rfc3339\" \ -- cgit v1.2.3-70-g09d2