A living almanac of seasons, soil, and the quiet knowledge that used to be common. Rust axum with minijinja and Vite.
agriculturealmanacaxumfolk-knowledgegardeningminijinjarustseasonalvite
1CARGO ?= $(HOME)/.cargo/bin/cargo
2PORT ?= 8000
3
4.DEFAULT_GOAL := run
5.PHONY: run build start clean push
6
7# Dev: Vite watch + cargo run concurrently. Both die on Ctrl+C.
8run: frontend/node_modules dist/.vite/manifest.json
9 @trap 'kill 0' EXIT INT TERM; \
10 (cd frontend && bun run dev) & \
11 PORT=$(PORT) $(CARGO) run
12
13# Production build (Vite assets + release binary)
14build: frontend/node_modules
15 cd frontend && bun run build
16 $(CARGO) build --release
17
18# Run the release binary (after `make build`)
19start:
20 PORT=$(PORT) ./target/release/darkfurrow
21
22# `content/` holds the almanac markdown (tracked in git, copied into the image),
23# so do NOT wipe it.
24clean:
25 rm -rf target dist frontend/node_modules
26
27push:
28 git remote | xargs -I R git push R master
29
30frontend/node_modules:
31 cd frontend && bun install
32
33dist/.vite/manifest.json: frontend/node_modules
34 cd frontend && bun run build