Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ site/
# Build artefact: the blog entrypoint mirrored where the blog plugin stats for
# it; the source of truth is blog/index.md. See hooks/publish_siblings.py.
docs/blog/

# Randomised dev-server port, picked once per clone
.serve-port
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.PHONY: help bootstrap site serve

PORT_FILE := .serve-port

## Show available targets
help:
@grep -B1 '^[a-z]' $(MAKEFILE_LIST) | grep '^##' | sed 's/## / /'
Expand All @@ -14,5 +16,10 @@ site:
NO_MKDOCS_2_WARNING=true uv run mkdocs build --strict

## Start the live-reloading dev server
serve:
NO_MKDOCS_2_WARNING=true uv run mkdocs serve -a localhost:80$$(( RANDOM % 10 ))$$(( RANDOM % 10 ))
serve: $(PORT_FILE)
NO_MKDOCS_2_WARNING=true uv run mkdocs serve -a localhost:$$(cat $(PORT_FILE))

# Pick a random port once and reuse it; delete the file to get a new one
$(PORT_FILE):
awk 'BEGIN { srand(); print 8000 + int(rand() * 1000) }' > $@
@echo "picked port $$(cat $@) (stored in $@)"
Loading