Single-binary self-hosted Markdown blog on Rust axum: no database, live search, Typst PDF export, and strong SEO.
axumblogdockermarkdownminijinjarustself-hostedtypstvite
1CARGO ?= $(HOME)/.cargo/bin/cargo
2PORT ?= 8000
3
4.DEFAULT_GOAL := run
5.PHONY: run build start bench 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/blog
21
22bench:
23 bench/run.sh
24
25clean:
26 rm -rf target dist frontend/node_modules
27
28push:
29 git remote | xargs -I R git push R master
30
31frontend/node_modules:
32 cd frontend && bun install
33
34dist/.vite/manifest.json: frontend/node_modules
35 cd frontend && bun run build