#!/bin/bash convert() { file=$1 filename=$(basename -- "$file") extension="${filename##*.}" filename="${filename%.*}" if [[ -f ../pages/$filename.md ]] then echo "making $filename.html" pandoc -s ../pages/$filename.md -t html > ../dist/$filename.html --lua-filter=links-to-html.lua fi } case $1 in convert) shift 1; convert "$@";; *) echo "?" ;; esac