mykiwi/mykiwi.blogpublic Fork
⑂ bcb209e
Commits
⬇ Clone ▾
git clone https://git.rickub.com/mykiwi/mykiwi.blog.git
git clone ssh://git@rickub.com/mykiwi/mykiwi.blog.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP

Say so when a build input is untrackedUnverified

nix build hands the derivation the repo as git knows it, so a file git
has never seen is not in the build at all. A new layout or asset can
be finished, working in `hugo server` - which reads the worktree - and
missing from the site everywhere else, with nothing in the output to
say why. Both `make prod-server` and `make deploy` then serve the gap,
the second of them to everyone.

Name the files before the build runs. Only the paths the build reads
are checked, and only files git would otherwise report, so a
gitignored one is not a surprise and does not become noise.

A warning and not an error: an untracked file next to the site's
sources is a normal thing to have half way through writing one, and
only the person looking at the list can say which case this is.
Romain Gautier committed 2026-09-21T00:05:04+02:00 Browse files
bcb209e parent: bb5f529
modified Makefile +20 -2
@@ -21,7 +21,7 @@ PROD_PORT ?= 8788
2121 # deploy-% targets aren't listed here: giving an instantiated pattern target
2222 # (e.g. deploy-en) to .PHONY creates an explicit no-recipe rule for it, which
2323 # then blocks the deploy-% pattern rule below from ever supplying a recipe.
24-.PHONY: help dev build serve prod-server infra-plan infra-apply deploy clean
24+.PHONY: help dev build check-tracked serve prod-server infra-plan infra-apply deploy clean
2525
2626 help:
2727 @grep -E '^[a-zA-Z_-]+:.*?## .*$$' Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-14s\033[0m %s\n", $$1, $$2}'
@@ -34,9 +34,27 @@ dev: ## Drop into the Hugo dev shell (hugo, dart-sass)
3434 # and so cannot be derived from the tree the sandbox is handed. `nix build` on
3535 # its own still works - it just builds pages that name the site's revision
3636 # instead of their own.
37-build: ## Build the site (all languages) into ./result
37+build: check-tracked ## Build the site (all languages) into ./result
3838 PAGE_COMMITS="$$(scripts/page-commits.sh)" nix build --impure
3939
40+# nix build hands the derivation the repo as git knows it, so a file git has
41+# never seen is not in the build at all - a new layout, partial or asset goes
42+# missing from the site with nothing in the output to say so, and `make
43+# prod-server` and `make deploy` both serve the gap. Only the paths the build
44+# actually reads are checked, and only files git would otherwise report: a
45+# gitignored one is not a surprise.
46+#
47+# A warning and not an error: an untracked file next to the site's sources is
48+# a normal thing to have half way through writing one, and only the person
49+# looking at the list can say which case this is.
50+check-tracked:
51+ @untracked="$$(git ls-files --others --exclude-standard -- blog scripts flake.nix flake.lock 2>/dev/null)"; \
52+ if [ -n "$$untracked" ]; then \
53+ printf '\033[33m%s\033[0m\n' "warning: untracked files - nix build cannot see these, so they will not be in the site:"; \
54+ printf '\033[33m %s\033[0m\n' $$untracked; \
55+ printf '\033[33m%s\033[0m\n\n' " git add them (a commit is not needed) to build with them."; \
56+ fi
57+
4058 serve: ## Run the Hugo dev server with live reload
4159 nix develop --command hugo server --source blog
4260
@@ -21,7 +21,7 @@ PROD_PORT ?= 8788
21 # deploy-% targets aren't listed here: giving an instantiated pattern target21 # deploy-% targets aren't listed here: giving an instantiated pattern target
22 # (e.g. deploy-en) to .PHONY creates an explicit no-recipe rule for it, which22 # (e.g. deploy-en) to .PHONY creates an explicit no-recipe rule for it, which
23 # then blocks the deploy-% pattern rule below from ever supplying a recipe.23 # then blocks the deploy-% pattern rule below from ever supplying a recipe.
24-.PHONY: help dev build serve prod-server infra-plan infra-apply deploy clean24+.PHONY: help dev build check-tracked serve prod-server infra-plan infra-apply deploy clean
25 25
26 help:26 help:
27 @grep -E '^[a-zA-Z_-]+:.*?## .*$$' Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-14s\033[0m %s\n", $$1, $$2}'27 @grep -E '^[a-zA-Z_-]+:.*?## .*$$' Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-14s\033[0m %s\n", $$1, $$2}'
@@ -34,9 +34,27 @@ dev: ## Drop into the Hugo dev shell (hugo, dart-sass)
34 # and so cannot be derived from the tree the sandbox is handed. `nix build` on34 # and so cannot be derived from the tree the sandbox is handed. `nix build` on
35 # its own still works - it just builds pages that name the site's revision35 # its own still works - it just builds pages that name the site's revision
36 # instead of their own.36 # instead of their own.
37-build: ## Build the site (all languages) into ./result37+build: check-tracked ## Build the site (all languages) into ./result
38 PAGE_COMMITS="$$(scripts/page-commits.sh)" nix build --impure38 PAGE_COMMITS="$$(scripts/page-commits.sh)" nix build --impure
39 39
40+# nix build hands the derivation the repo as git knows it, so a file git has
41+# never seen is not in the build at all - a new layout, partial or asset goes
42+# missing from the site with nothing in the output to say so, and `make
43+# prod-server` and `make deploy` both serve the gap. Only the paths the build
44+# actually reads are checked, and only files git would otherwise report: a
45+# gitignored one is not a surprise.
46+#
47+# A warning and not an error: an untracked file next to the site's sources is
48+# a normal thing to have half way through writing one, and only the person
49+# looking at the list can say which case this is.
50+check-tracked:
51+ @untracked="$$(git ls-files --others --exclude-standard -- blog scripts flake.nix flake.lock 2>/dev/null)"; \
52+ if [ -n "$$untracked" ]; then \
53+ printf '\033[33m%s\033[0m\n' "warning: untracked files - nix build cannot see these, so they will not be in the site:"; \
54+ printf '\033[33m %s\033[0m\n' $$untracked; \
55+ printf '\033[33m%s\033[0m\n\n' " git add them (a commit is not needed) to build with them."; \
56+ fi
57+
40 serve: ## Run the Hugo dev server with live reload58 serve: ## Run the Hugo dev server with live reload
41 nix develop --command hugo server --source blog59 nix develop --command hugo server --source blog
42 60