diff --git a/make.sh b/make.sh index 55ee0a2..254a13a 100755 --- a/make.sh +++ b/make.sh @@ -4,18 +4,22 @@ targetDir='post/' post() { tmp=".swap" + full=".fullswap" base=$(basename $1) - # Glue all the things - pandoc $1 | cat 'templates/post-header.html' - 'templates/post-footer.html' >> $tmp - sed -i "5i ${base%.*}" $tmp - sed -i "s///g' $tmp - # turn the header into an actual header - sed -i '30i
' $tmp - sed -i '33i
' $tmp - # finally move this post to its proper location in the _rootDir - mv $tmp "$rootDir/$targetDir/${base%.*}.html" + # First build the content of the site + pandoc $1 | sed '3i ' >> $tmp + sed -i '1i
' $tmp + # next we glue together the header and footer + cat ./templates/post-header.html $tmp ./templates/post-footer.html > $full rm -f $tmp + # Title, images and tables get added/fixed here + sed -i "5i ${base%.*}" $full + sed -i "s//
/g' $full + + # finally move this post to its proper location in the _rootDir + mv $full "$rootDir/$targetDir/${base%.*}.html" + rm -f $full } [[ -z $rootDir/post/ ]] && mkdir -p $rootDir/post