prettier tables and side bar
This commit is contained in:
parent
3308a70d54
commit
95b03f6472
20
make.sh
20
make.sh
@ -1,15 +1,17 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# compiles new post into target directory
|
|
||||||
rootDir='./tmp/'
|
rootDir='./tmp/'
|
||||||
|
|
||||||
|
[[ -z $rootDir/post/ ]] && mkdir -p $rootDir/post
|
||||||
|
|
||||||
post() {
|
post() {
|
||||||
# First get the body of the document
|
# First get the body of the document
|
||||||
tmp=".swap"
|
tmp=".swap"
|
||||||
base=$(basename $1)
|
base=$(basename $1)
|
||||||
cat 'templates/post-header.html' > $tmp
|
# cat the files together
|
||||||
pandoc $1 >> $tmp
|
pandoc $1 | cat 'templates/post-header.html' - 'templates/post-footer.html' >> $tmp
|
||||||
cat 'templates/post-footer.html' >> $tmp
|
sed -i "5i <title>${base%.*}</title>" $tmp
|
||||||
sed -i "3i <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
|
# finally move this post to its proper location in the _rootDir
|
||||||
mv $tmp "$rootDir/post/${base%.*}.html"
|
mv $tmp "$rootDir/post/${base%.*}.html"
|
||||||
rm -f $tmp
|
rm -f $tmp
|
||||||
@ -19,3 +21,11 @@ target=""
|
|||||||
for file in $@;do
|
for file in $@;do
|
||||||
post $file
|
post $file
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ -z $@ ]
|
||||||
|
then
|
||||||
|
while read line
|
||||||
|
do
|
||||||
|
post $line
|
||||||
|
done < "${1:-/dev/stdin}"
|
||||||
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user