From af75a700c52aaca66ffe6db42c4448c2070be21a Mon Sep 17 00:00:00 2001 From: davidovski Date: Tue, 18 Apr 2023 11:46:44 +0100 Subject: make md2html accept arguments --- src/shblg | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'src/shblg') diff --git a/src/shblg b/src/shblg index 5361975..ff10250 100644 --- a/src/shblg +++ b/src/shblg @@ -1,4 +1,23 @@ #!/bin/sh -BLOG_DIR -OUTPUT_DIR +INPUT_DIR=blog +OUTPUT_DIR=dist +PAGE_TEMPLATE=blog/template.html + +while getopts ":o:i:t:" opt; do + case "$opt" in + o) + OUTPUT_DIR=$(realpath $OPTARG) + ;; + i) + INPUT_DIR=$(realpath $OPTARG) + ;; + t) + PAGE_TEMPLATE=$(realpath $OPTARG) + ;; + esac +done + +for f in ${INPUT_DIR}/*.md; do + md2html "$f" > ${OUTPUT_DIR}/$f +done -- cgit v1.2.1