47 lines
874 B
Bash
Executable File
47 lines
874 B
Bash
Executable File
#!/bin/bash
|
|
# compiles new post into target directory
|
|
rootDir='./_dank/'
|
|
|
|
mdRoot='./prebild/'
|
|
mPostDir='./prebuild/post/'
|
|
|
|
# Right now:
|
|
# no images
|
|
# root pages
|
|
# post pages
|
|
|
|
post() {
|
|
# First get the body of the document
|
|
body=$(pandoc $1)
|
|
cat 'templates/post-header.html' && echo $body && cat 'templates/post-footer.html'
|
|
# inject some page specific things like the title and favicon
|
|
}
|
|
|
|
# Options:
|
|
# -f post-file
|
|
# -s stylesheet
|
|
#[[ -z $# ]] && echo "./make.sh -h" && echo 'for more info' && exit 0
|
|
|
|
target=""
|
|
stylesheet=""
|
|
while getopts "f:s:h" opt; do
|
|
case $opt in
|
|
h)
|
|
echo '-h shows this prompt'
|
|
echo '-s specifiy a custom stylesheet'
|
|
;;
|
|
s)
|
|
stylesheet=$2
|
|
echo "Stylesheet: $2"
|
|
;;
|
|
f)
|
|
target=$2
|
|
echo "Target post $2"
|
|
;;
|
|
esac
|
|
done
|
|
|
|
# attempt to build the new post
|
|
[[ -z $target ]] && echo 'No target' && exit 0
|
|
post $target $stylesheet
|