diff options
author | Bill <bill@billserver.senders.io> | 2022-11-04 15:28:06 -0400 |
---|---|---|
committer | Bill <bill@billserver.senders.io> | 2022-11-04 15:28:06 -0400 |
commit | 5421fe09cc64c2ceae18e074251a5c22be874101 (patch) | |
tree | 4d1ee3e0fad033692071f7b0d06fc762a8e6de1b /compile-md.sh | |
parent | 2ea173ec64afaf0921e3876e095bf53fed2ca545 (diff) |
Update wishlist from .md source
Diffstat (limited to 'compile-md.sh')
-rwxr-xr-x | compile-md.sh | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/compile-md.sh b/compile-md.sh index f79f742..7b982c0 100755 --- a/compile-md.sh +++ b/compile-md.sh @@ -2,18 +2,20 @@ set -ex -if [ $# -ne 3 ]; then - echo "./compile-md.sh [page|blog] [in.md] [out.html]" +if [ $# -ne 4 ]; then + echo "./compile-md.sh [page|blog] [title] [in.md] [out.html]" exit 1 fi -in=$2 -out=$3 +ptype=$1 +title=$2 +in=$3 +out=$4 -if [ $1 == "blog" ]; then +if [ $ptype == "blog" ]; then cat templates/blog-header.html > $out else - if [ $1 == "page" ]; then + if [ $ptype == "page" ]; then cat templates/page-header.html > $out else echo "Missing first parameter: [page|blog]" @@ -21,6 +23,10 @@ else fi fi +pclass=$(echo "$title" | tr [:upper:] [:lower:]) +sed -ie "s/PAGE_TITLE/$title/" $out # replace title +sed -ie "s/PAGE_CLASS/$pclass/" $out # replace class + markdown $in >> $out if [ $1 == "blog" ]; then |