aboutsummaryrefslogtreecommitdiff
path: root/scripts/postinfo
blob: d6da0158a7b03de5cb742d0acd7e16ec81b36f71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

cd "$(dirname $0)"

filename=$1

jq -n \
	--argjson title    "$(./meta title $filename)" \
	--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
}'