diff --git a/Makefile b/Makefile index 0674195..78a69cd 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,41 @@ -all: clean format build +# -------- Config -------- +SHELL := /bin/sh -format: - biome format --write . +ZOLA ?= zola +BIOME ?= npx biome -build: - zola build +BUILD_DIR := public + +# -------- Targets -------- +.PHONY: help serve build clean format lint fix fix-unsafe check ci + +help: ## Show this help + @awk 'BEGIN{FS":.*##"; printf "\nTargets:\n"} /^[a-zA-Z0-9_.-]+:.*##/{printf " \033[36m%-14s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST); echo + +serve: ## Run Zola dev server (http://127.0.0.1:1111) + $(ZOLA) serve + +build: ## Build site into ./public + $(ZOLA) build + +clean: ## Remove ./public + rm -rf "$(BUILD_DIR)" + +format: ## Format JS/JSON/CSS with Biome (no linting) + $(BIOME) format --write . + +lint: ## Lint with Biome (no writes) + $(BIOME) ci . + +fix: ## Lint+auto-fix safe changes with Biome + $(BIOME) check --write . + +fix-unsafe: ## Lint+auto-fix incl. unsafe (e.g., template literals) + $(BIOME) check --write --unsafe . + +check: ## Zola link/content checks + $(ZOLA) check + +ci: ## CI-friendly: lint (Biome) + Zola checks + $(BIOME) ci . && $(ZOLA) check -clean: - rm -rf public/