diff options
author | davidovski <david@davidovski.xyz> | 2023-04-18 11:46:44 +0100 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2023-04-18 11:46:44 +0100 |
commit | af75a700c52aaca66ffe6db42c4448c2070be21a (patch) | |
tree | bd3d493c02293a94953918d1516c6f5b8a6fc6a3 /src/shblg | |
parent | e4c9a5a027ececc1e72744287be7e3654e31289e (diff) |
make md2html accept arguments
Diffstat (limited to 'src/shblg')
-rw-r--r-- | src/shblg | 23 |
1 files changed, 21 insertions, 2 deletions
@@ -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 |