simplifying build model
This commit is contained in:
parent
db085acd1f
commit
35a0876b99
31
make.sh
31
make.sh
@ -1,19 +1,21 @@
|
||||
# compiles new post into target directory
|
||||
rootDir='./_site/'
|
||||
|
||||
mPageDir='./markdown/page/'
|
||||
mdRoot='./markdown/'
|
||||
mPostDir='./markdown/post/'
|
||||
|
||||
img() {
|
||||
# each post/page should have their own directory with the same name as that post/page
|
||||
cp -r img/$1 $rootDir/img/
|
||||
}
|
||||
# Right now:
|
||||
# no images
|
||||
# root pages
|
||||
# post pages
|
||||
|
||||
post() {
|
||||
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() {
|
||||
[[ -z $1 ]] && echo 'No target given' && exit 0
|
||||
# Updating index style
|
||||
cp style.css $rootDir/style.css
|
||||
|
||||
@ -24,18 +26,13 @@ style() {
|
||||
cp style.css $rootDir/post/style.css
|
||||
}
|
||||
|
||||
page() {
|
||||
pandoc $mPageDir/$1 --css style.css -s -o $rootDir/page/${1%.*}.html
|
||||
}
|
||||
|
||||
# literally just updates the index file nothing else
|
||||
index() {
|
||||
# base index file
|
||||
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
|
||||
root() {
|
||||
if [[ -z $2 ]]
|
||||
then
|
||||
pandoc $mdRootr/$1 --css style.css -s -o $rootDir/page/${1%.*}.html
|
||||
exit 0
|
||||
fi
|
||||
pandoc $mdRootr/$1 --css $2 -s -o $rootDir/${1%.*}.html
|
||||
}
|
||||
|
||||
# taking function names as param
|
||||
|
Loading…
Reference in New Issue
Block a user