From e798b60c79e691699d92ea5b2a5a94a3ab1cd61b Mon Sep 17 00:00:00 2001 From: shockrahwow Date: Sat, 8 Jun 2019 00:12:56 -0700 Subject: [PATCH] finally got rid of the hard coded bs things --- make.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) 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