#!/bin/bash md2html() { name=$1.html pandoc --smart -s $1.md -f markdown+fenced_code_attributes -t html -o "_tmp" cat header.html "_tmp" > $name echo $footer >> $name rm "_tmp" } udate=$(date +%Y-%m-%dT%H:%M%z) footer="
This page was last updated on: $udate
" if [ -z "$1" ]; then for entry in *.md do md2html ${entry%???} done else md2html $1 fi