#!/bin/bash set -euxo pipefail cd "${BASH_SOURCE[0]%/*}" rm -rf build mkdir build ( echo "Building HTML" shopt -s extglob while IFS= read -r -d '' || [[ "${REPLY}" ]]; do cat header.html "${REPLY}" footer.html >"./build/${REPLY}" done < <(find . -maxdepth 1 -type f -name '*.html' -not -name 'header.html' -and -not -name 'footer.html' -print0) ) cp -vr css/ images/ build/ # ( # echo "Building images" # for i in ./assets/*.*; do # if (($(stat -c %Y "${i}") > $(stat -c %Y "${i}"))); then # fi # )