#!/bin/sh filename=$1 jq -n \ --argjson title "$(./meta title $filename || '\n')" \ --argjson subtitle "$(./meta subtitle $filename)" \ --argjson author "$(./meta author $filename)" \ --argjson date "$(./meta date $filename)" \ --argjson tags "$(./meta tags $filename)" \ --argjson cover "$(./meta cover $filename)" \ --argjson id "$(basename $filename .md | jq --raw-input)" \ '{ "title": $title, "subtitle": $subtitle, "author": $author, "date": $date, "tags": $tags, "cover": $cover, "id": $id }'