From 0d62dadd389363ffb7d16ed6d138bd9696182651 Mon Sep 17 00:00:00 2001 From: Medium Fries Date: Sun, 25 Nov 2018 15:37:40 -0800 Subject: [PATCH] copying useful new makefile from posting branch --- make.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/make.sh b/make.sh index f6535f9..641a397 100755 --- a/make.sh +++ b/make.sh @@ -1,4 +1,4 @@ -# builds a sick post +# compiles new post into target directory post() { # check directory existence if [ -f markdown/post/$1 ] @@ -6,24 +6,35 @@ post() { # compile the new post and drop it in ./post/ pandoc markdown/post/$1 --css bstyle.css -s -o post/${1%.*}.html else + # error message incase file was not found echo "File \"$1\" not found in markdown/post" fi } -# builds a site "page" like the about page, links page etc +# mainly to create new post files +writep() { + if [ -z $1 ] + then + echo 'No filename given' + exit 0 + fi + cp ./markdown/template.md ./markdown/post/$1 + vim -c "Goyo" ./markdown/post/$1 +} + page() { # we want to enforce maintainence of directory structure if [ -f markdown/pages/$1 ] then - # compile then drop in ./page/ pandoc markdown/pages/$1 --css bstyle.css -s -o page/${1%.*}.html else echo "File \"$1\" not found in markdown/pages" fi } +# literally just updates the index file nothing else index() { - pandoc index.md --css style.css -s -o index.html # typing succs + pandoc ./markdown/index.md --css style.css -s -o index.html # typing succs } help() { @@ -44,4 +55,5 @@ help() { esac } +# taking function names as para "$@"