aboutsummaryrefslogtreecommitdiff
path: root/scripts/postinfo
diff options
context:
space:
mode:
authorlonkaars <l.leblansch@gmail.com>2021-04-01 12:47:12 +0200
committerlonkaars <l.leblansch@gmail.com>2021-04-01 12:47:12 +0200
commit5a9da62ded70cfb05309aebcb1c1ee09d17948c5 (patch)
tree0ddbdff0a75279bd6d4dae48fe83510cb5e32108 /scripts/postinfo
parent71ab18ec4264197aae27efe64e4565c4989a19cd (diff)
added scripts for post meta json things
Diffstat (limited to 'scripts/postinfo')
-rwxr-xr-xscripts/postinfo20
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/postinfo b/scripts/postinfo
new file mode 100755
index 0000000..94827f1
--- /dev/null
+++ b/scripts/postinfo
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+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 urlname "$(basename $filename .md | jq --raw-input)" \
+'{
+ "title": $title,
+ "subtitle": $subtitle,
+ "author": $author,
+ "date": $date,
+ "tags": $tags,
+ "urlname": $urlname
+}'
+