Files
CS1534CA3/justfile
bluepython508 d6ef3d511c Initial Setup
Tooling:
  nix/direnv to ensure dependencies are present
  jinja-based templating to avoid duplication of common sections of pages
    (header and footer, primarily)
  auto-rebuilding server for rapid iteration
2024-03-05 09:42:02 +00:00

22 lines
466 B
Makefile

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