#!/usr/bin/env sh # #build posts/* to html strip_extension() { echo "$1" | rev | cut -d'.' -f2- | rev } pipe_exec() { "$1" "$(cat)" } # clean old builds rm posts/*.html index.html projects/*.html # Legacy .post files are just markdown, hack in the stylesheet and title because I'm lazy... for f in posts/*.post; do markdown < "$f" | echo \ "$(basename "$f") " \ "$(cat)" \ > "$(strip_extension "$f")".html done # shmd things for f in */*.md; do shmd < "$f" | markdown > "$(strip_extension "$f")".html done shmd < index.md | markdown > index.html