1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
.DEFAULT_GOAL := help
# CLOUDFLARE_API_TOKEN lives in .env (gitignored, copy from .env.dist) -
# load it into every recipe's environment, e.g. for infra-plan/infra-apply/deploy.
ifneq (,$(wildcard .env))
include .env
export
endif
.PHONY: help dev build serve infra-plan infra-apply deploy clean
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-14s\033[0m %s\n", $$1, $$2}'
dev: ## Drop into the Hugo dev shell (hugo, dart-sass)
nix develop
build: ## Build the site (all languages) into ./result
nix build
serve: ## Run the Hugo dev server with live reload
nix develop --command hugo server
infra-plan: ## Show what infra-apply would change on Cloudflare
nix run .#infra -- plan
infra-apply: ## Apply infra/ changes to Cloudflare
nix run .#infra -- apply
deploy: ## Build the site and push it to Cloudflare Pages (all languages)
nix run .#deploy
clean: ## Remove build outputs
rm -rf result blog/public blog/resources
|