mirror of
https://github.com/ivabus/www
synced 2024-11-10 06:25:14 +03:00
17 lines
461 B
Bash
17 lines
461 B
Bash
|
#!/bin/sh
|
||
|
# cmd: $ ./build-package-pages.sh srcJson targetPath
|
||
|
# sample: $ .github/build-package-pages.sh src/data/packages.json src/content/packages'
|
||
|
|
||
|
for row in $(cat $1 | jq -r '.[] | @base64'); do
|
||
|
_jq() {
|
||
|
echo ${row} | base64 --decode | jq -r ${1}
|
||
|
}
|
||
|
touch $2/$(_jq '.name').md
|
||
|
content="---
|
||
|
type: page
|
||
|
title: \"$(_jq '.name')\"
|
||
|
Description: \"$(_jq '.desc')\"
|
||
|
layout: \"package-detail\"
|
||
|
---"
|
||
|
echo "$content" > $2/$(_jq '.name').md
|
||
|
done
|