#!/bin/bash rootDir='./tmp/' [[ -z $rootDir/post/ ]] && mkdir -p $rootDir/post post() { # First get the body of the document tmp=".swap" base=$(basename $1) # cat the files together pandoc $1 | cat 'templates/post-header.html' - 'templates/post-footer.html' >> $tmp sed -i "5i