#!/usr/bin/env bash
set -euo pipefail

template="template.html"
[[ -f "$template" ]] || {
    echo "Missing $template" >&2
    exit 1
}

shopt -s nullglob
for md in *.md; do
    html="${md%.md}.html"
    pandoc \
        --template="$template" \
        --standalone \
        -o "$html" \
        "$md"
    echo "Generated: $html"
done
