From c796ab18963ef11bd42b69a6d4fdf00468ef3e75 Mon Sep 17 00:00:00 2001 From: Medium Fries Date: Sun, 25 Nov 2018 15:34:30 -0800 Subject: [PATCH] New write post function --- make.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/make.sh b/make.sh index 92a995e..641a397 100755 --- a/make.sh +++ b/make.sh @@ -1,5 +1,4 @@ -# not only updates the post but inserts the description found in desc.md into the index.md then recompiles -# only gets called if +# compiles new post into target directory post() { # check directory existence if [ -f markdown/post/$1 ] @@ -12,6 +11,17 @@ post() { fi } +# 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 ] @@ -22,16 +32,9 @@ page() { fi } -# TODO: update the func so that it injects a description into the markdown file and then compiles -# Using this function to update the index -function updateindex() { - arg1 = $1 - arg2 = $2 -} - # 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() { @@ -52,4 +55,5 @@ help() { esac } +# taking function names as para "$@"