dir:
	mkdir -p build

template: dir
	#!/usr/bin/env python3
	from jinja2 import Environment, FileSystemLoader
	from glob import glob
	env = Environment(loader=FileSystemLoader('.'))
	for file in glob("*", root_dir="pages/"):
		with open(f"build/{file}", "w") as out:
			out.write(env.get_template(f"pages/{file}").render())

build: template
	cp -r static/ build/

serve: build
	simple-http-server --index --nocache build/

watch:
	watchexec --restart -- just serve

