#! /bin/bash md=`find . -name "*.md"` for file in $md; do # build the page into an intermediate file, so when I reload in the browser, # it's not a 50/50 whether the page is empty or not. cat header.html > build.html pandoc -f markdown -t html $file | iconv -f UTF-8 -t ASCII//TRANSLIT >> build.html cat footer.html >> build.html cp build.html `echo $file | sed s/\.md$/.html/` done rm build.html