finally got rid of the hard coded bs things

This commit is contained in:
shockrahwow 2019-06-08 00:12:56 -07:00
parent eab7a879ad
commit e798b60c79

24
make.sh
View File

@ -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 <title>${base%.*}</title>" $tmp
sed -i "s/<img/<img class=\"pure-img\"/g" $tmp
sed -i 's/<table>/<table class="pure-table">/g' $tmp
# turn the header into an actual header
sed -i '30i <div class="header">' $tmp
sed -i '33i </div>' $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 </div>' >> $tmp
sed -i '1i <div class="header">' $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 <title>${base%.*}</title>" $full
sed -i "s/<img/<img class=\"pure-img\"/g" $full
sed -i 's/<table>/<table class="pure-table">/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