set -e

mkdir -p web
$(which cp) style.css about.mdwn run-gallery.js gallerie/jquery.gallerie.js gallerie.css gallerie/loading.gif web/
for I in data/*.jpg; do
    test -f $(echo $I | sed 's/data/web/') || cp $I web
done

./process.hs data web
for i in $(find web -type f -name '*.mdwn'); do
    HTML=$(echo $i | sed 's,.mdwn$,.html,')
    pandoc --to=html -s --smart -o $HTML --template template.html $i
done
    
