From 5421fe09cc64c2ceae18e074251a5c22be874101 Mon Sep 17 00:00:00 2001 From: Bill Date: Fri, 4 Nov 2022 15:28:06 -0400 Subject: Update wishlist from .md source --- compile-md.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'compile-md.sh') 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 -- cgit v1.2.3-54-g00ecf