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
This commit is contained in:
Ben Soroos
2024-03-12 11:55:48 +00:00
commit 929b14104b
8 changed files with 104 additions and 0 deletions

21
justfile Normal file
View File

@@ -0,0 +1,21 @@
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