simplifying build model

This commit is contained in:
Medium Fries 2019-04-24 15:31:49 -07:00
parent db085acd1f
commit 35a0876b99

31
make.sh
View File

@ -1,19 +1,21 @@
# compiles new post into target directory # compiles new post into target directory
rootDir='./_site/' rootDir='./_site/'
mPageDir='./markdown/page/' mdRoot='./markdown/'
mPostDir='./markdown/post/' mPostDir='./markdown/post/'
img() { # Right now:
# each post/page should have their own directory with the same name as that post/page # no images
cp -r img/$1 $rootDir/img/ # root pages
} # post pages
post() { post() {
pandoc $mPostDir/$1 --css style.css -s -o $rootDir/post/${1%.*}.html pandoc $mPostDir/$1 --css style.css -s -o $rootDir/post/${1%.*}.html
# TODO: do acheck for images and build if there are any images
} }
style() { style() {
[[ -z $1 ]] && echo 'No target given' && exit 0
# Updating index style # Updating index style
cp style.css $rootDir/style.css cp style.css $rootDir/style.css
@ -24,18 +26,13 @@ style() {
cp style.css $rootDir/post/style.css cp style.css $rootDir/post/style.css
} }
page() { root() {
pandoc $mPageDir/$1 --css style.css -s -o $rootDir/page/${1%.*}.html if [[ -z $2 ]]
} then
pandoc $mdRootr/$1 --css style.css -s -o $rootDir/page/${1%.*}.html
# literally just updates the index file nothing else exit 0
index() { fi
# base index file pandoc $mdRootr/$1 --css $2 -s -o $rootDir/${1%.*}.html
pandoc ./markdown/index.md --css style.css -s -o $rootDir/index.html # typing succs
# next we inject the navbar html stuff
sed -i '7r ./templates/navbar.html' $rootDir/index.html
# finally inject the link for the favicon
sed -i '3r ./templates/favicon.html' $rootDir/index.html
} }
# taking function names as param # taking function names as param