prettier tables and side bar

This commit is contained in:
shockrahwow 2019-04-26 15:18:05 -07:00
parent 3308a70d54
commit 95b03f6472

20
make.sh
View File

@ -1,15 +1,17 @@
#!/bin/bash
# compiles new post into target directory
rootDir='./tmp/'
[[ -z $rootDir/post/ ]] && mkdir -p $rootDir/post
post() {
# First get the body of the document
tmp=".swap"
base=$(basename $1)
cat 'templates/post-header.html' > $tmp
pandoc $1 >> $tmp
cat 'templates/post-footer.html' >> $tmp
sed -i "3i <title>${base%.*}</title>" $tmp
# cat the files together
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
# finally move this post to its proper location in the _rootDir
mv $tmp "$rootDir/post/${base%.*}.html"
rm -f $tmp
@ -19,3 +21,11 @@ target=""
for file in $@;do
post $file
done
if [ -z $@ ]
then
while read line
do
post $line
done < "${1:-/dev/stdin}"
fi