echo"$front_matter"| sed '1d;$d'| sed 's/^/ "/'| sed 's/: /": "/'| sed 's/$/"/'| tr '\n'','| sed 's/,$//'| sed 's/"tags": "\[\(.*\)\]"/"tags": \[\1\]/g'| sed "s/'/\"/g"
}
# Find files via Regex
# Find all files in /public/blog/*.md
# Process and extract the front matter of each file.
# Output the JSON representation of the front matter.
extract_files(){
localfiles=$(find public/blog -type f -name "*.md")
for file in $files;do
# Enter, create {} for each file
echo" {"
echo" \"metadata\": {"
localdata=$(cat $file)
localfront_matter=$(extract_front_matter "$data")
echo"$front_matter"
echo" },"
# Add the id and url
localid=$(echo"$file"| sed 's/public\/blog\///'| sed 's/\.md//')