diff --git a/scripts/meta-json.sh b/scripts/meta-json.sh new file mode 100644 index 0000000000000000000000000000000000000000..0c81ef82b7d9154142290ffe72ddaf9c14be3abd --- /dev/null +++ b/scripts/meta-json.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +find content/docs -type d -exec bash -c 'cd "{}" && DIR=$(basename "$PWD"); TITLE=$(echo "$DIR" | sed -E "s/^(.)/\U\1/") && jq -n --arg title "$TITLE" --argjson pages "$(ls *.mdx 2>/dev/null | sed "s/\.mdx$//" | jq -R . | jq -s .)" "{title: \$title, pages: \$pages}" > meta.json' \; + +exit 0