From c3341a6cb3639e3e49a8b9e771a39c3f121cb2e2 Mon Sep 17 00:00:00 2001 From: shockrahwow Date: Wed, 13 Mar 2019 14:53:50 -0700 Subject: [PATCH] easier to read and removed some pointless branches --- make.sh | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/make.sh b/make.sh index 2be49c8..5235bc8 100755 --- a/make.sh +++ b/make.sh @@ -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