blog/build.sh

19 lines
387 B
Bash
Executable File

#!/usr/bin/bash
# copy assets
cp -r assets/ dist/
make_page() {
name="$1"
title="$2"
cp templates/index.tmpl.html "build/$name.html"
sed -i "s/<title>/&$title/" "build/$name.html"
pandoc "pages/$name.md" > "build/$name-content.html"
sed -i "/<main>/r build/$name-content.html" "build/$name.html"
cp "build/$name.html" dist/
}
make_page index Home
make_page stuff Stuff