Skip to content

Commit 5a450cc

Browse files
committed
Versioned docs
Signed-off-by: Daneyon Hansen <[email protected]>
1 parent 4c319af commit 5a450cc

File tree

24 files changed

+34
-6
lines changed

24 files changed

+34
-6
lines changed

Makefile

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ endif
6969
# The name of the kind cluster to use for the "kind-load" target.
7070
KIND_CLUSTER ?= kind
7171

72+
# Docs version variables
73+
VERSION ?= v0.3.0
74+
ALIAS ?= latest
75+
7276
##@ General
7377

7478
# The help target prints out all targets with their descriptions organized
@@ -275,10 +279,25 @@ build-docs:
275279
docker build --pull -t gaie/mkdocs hack/mkdocs/image
276280
docker run --rm -v ${PWD}:/docs gaie/mkdocs build
277281

278-
.PHONY: build-docs-netlify
279-
build-docs-netlify:
280-
pip install -r hack/mkdocs/image/requirements.txt
281-
python -m mkdocs build
282+
.PHONY: build-docs-versioned
283+
build-docs-versioned:
284+
@echo "→ Building docs version '$(VERSION)' (alias '$(ALIAS)')…"
285+
286+
# Install dependencies (mkdocs, plugins, mike, etc.)
287+
pip install --user -r hack/mkdocs/image/requirements.txt
288+
pip install --user mike
289+
290+
# Build the static site into 'site/'
291+
python -m mkdocs build --site-dir site
292+
293+
# Determine where pip put the 'mike' script,then invoke versioning explicitly by path
294+
USER_BASE := $(shell python3 -m site --user-base)
295+
MIKE_BIN := $(USER_BASE)/bin/mike
296+
297+
$(MIKE_BIN) deploy --update-aliases $(VERSION) $(ALIAS) site docs
298+
$(MIKE_BIN) set-default $(ALIAS) docs
299+
300+
@echo "Site built in site/, versions written to docs/"
282301

283302
.PHONY: live-docs
284303
live-docs:

docs/dev.md renamed to dev/dev.md

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)