diff --git a/.gitignore b/.gitignore index 1377554..d441580 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.swp +test* diff --git a/make.sh b/make.sh index e831bb7..2620aa3 100755 --- a/make.sh +++ b/make.sh @@ -1,10 +1,19 @@ +# not only updates the post but inserts the description found in desc.md into the index.md then recompiles +# only gets called if post() { # check directory existence if [ -f markdown/post/$1 ] then + # compile the new post and drop it in ./post/ pandoc markdown/post/$1 --css bstyle.css -s -o post/${1%.*}.html + # check to see if we have to rebuild the post or not + if [ $2 == "n" ] + then + echo "changing index.html for brand new post" + fi else - echo "Check parameters as well: ./make.sh fileType inputFile" + # error message incase file was not found + echo "File \"$1\" not found in markdown/post" fi } @@ -19,9 +28,21 @@ page() { } help() { - echo "Usage: \./make.sh fileType targetSource" - echo "fileType - \[post, page\] - specifices type of html doc to create" - echo "targetSource - the file itself that you created in the /markdown directory" + case $1 in + type) + echo -e "[post, page] \n\tThe kind of page you want to add to the site" + echo "Different types result in different compilation locations" + ;; + target) + echo "The file that you want to actually compile to html" + ;; + flag) + echo -e "Available flags:\n\tr - rebuilds file, does not update index.html\n\tn - builds file, updates index.html" + echo -e "\t*Pages will not update index.html*" + ;; + *) + echo "./make.sh type target.md flag" + esac } "$@"