inject maintainer into the metadata

This commit is contained in:
Jacob Heider 2022-11-01 16:09:04 -04:00
parent f56e4a1387
commit 33d931ef3b
No known key found for this signature in database
GPG key ID: 59D15ADC7DCD39BB

View file

@ -2,16 +2,17 @@
# cmd: $ ./build-package-pages.sh srcJson targetPath # cmd: $ ./build-package-pages.sh srcJson targetPath
# sample: $ .github/build-package-pages.sh src/data/packages.json src/content/packages' # sample: $ .github/build-package-pages.sh src/data/packages.json src/content/packages'
for row in $(cat $1 | jq -r '.[] | @base64'); do for row in $(jq -r '.[] | @base64' < "$1"); do
_jq() { _jq() {
echo ${row} | base64 --decode | jq -r ${1} echo "${row}" | base64 --decode | jq -r "${1}"
} }
touch $2/$(_jq '.slug').md touch "$2"/"$(_jq '.slug')".md
content="--- content="---
type: page type: page
title: \"$(_jq '.name')\" title: \"$(_jq '.name')\"
maintainer: \"$(_jq '.maintainer')\"
Description: \"$(_jq '.desc' | tr '\"' "'")\" Description: \"$(_jq '.desc' | tr '\"' "'")\"
layout: \"package-detail\" layout: \"package-detail\"
---" ---"
echo "$content" > $2/$(_jq '.slug').md echo "$content" > "$2"/"$(_jq '.slug')".md
done done