.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 # languages.txt is the single source of truth for the site's language set, # shared with infra/main.tf - blog/hugo.toml's [languages.*] blocks are the # one place it can't drive directly (Tofu has no TOML parser), so keep those # in sync by hand. LANGS := $(shell cat languages.txt) # deploy-% targets aren't listed here: giving an instantiated pattern target # (e.g. deploy-en) to .PHONY creates an explicit no-recipe rule for it, which # then blocks the deploy-% pattern rule below from ever supplying a recipe. .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 --source blog 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 ## Build the site and push it to Cloudflare Pages (all languages, in parallel) $(MAKE) --no-print-directory --output-sync=target -j$(words $(LANGS)) $(addprefix deploy-,$(LANGS)) deploy-%: ## Deploy a single language to Cloudflare Pages, e.g. `make deploy-en` (assumes `make build` already ran) nix run .#deploy -- $* clean: ## Remove build outputs rm -rf result blog/public blog/resources