easier to read and removed some pointless branches

This commit is contained in:
shockrahwow 2019-03-13 14:53:50 -07:00
parent 1643a6f8f3
commit c3341a6cb3

23
make.sh
View File

@ -1,15 +1,11 @@
# compiles new post into target directory
rootDir='./_site/'
mPageDir='./markdown/page/'
mPostDir='./markdown/post/'
post() {
# check directory existence
if [ -f markdown/post/$1 ]
then
# CSS file is always relative to the target html location
pandoc markdown/post/$1 --css style.css -s -o $rootDir/post/${1%.*}.html
else
# error message incase file was not found
echo "File \"$1\" not found in markdown/post"
fi
pandoc $mPostDir/$1 --css style.css -s -o $rootDir/post/${1%.*}.html
}
style() {
@ -26,13 +22,8 @@ style() {
}
page() {
# we want to enforce maintainence of directory structure
if [ -f markdown/pages/$1 ]
then
pandoc markdown/pages/$1 --css style.css -s -o $rootDir/page/${1%.*}.html
else
echo "File \"$1\" not found in markdown/pages"
fi
pandoc $mPageDir/$1 --css style.css -s -o $rootDir/page/${1%.*}.html
}
# literally just updates the index file nothing else