Skip to content

Commit c9ed32f

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

File tree

24 files changed

+33
-6
lines changed

24 files changed

+33
-6
lines changed

Makefile

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,15 +270,33 @@ bbr-image-kind: bbr-image-build ## Build the image and load it to kind cluster $
270270

271271
##@ Docs
272272

273+
VERSION ?= v0.3.0
274+
ALIAS ?= latest
275+
276+
# Compute where pip --user installs scripts
277+
USER_BASE := $(shell python3 -m site --user-base)
278+
MIKE_BIN := $(USER_BASE)/bin/mike
279+
273280
.PHONY: build-docs
274281
build-docs:
275282
docker build --pull -t gaie/mkdocs hack/mkdocs/image
276283
docker run --rm -v ${PWD}:/docs gaie/mkdocs build
277284

278-
.PHONY: build-docs-netlify
279-
build-docs-netlify:
280-
pip install -r hack/mkdocs/image/requirements.txt
281-
python -m mkdocs build
285+
.PHONY: build-docs-versioned
286+
build-docs-versioned:
287+
@echo "→ Building docs version '$(VERSION)' (alias '$(ALIAS)')…"
288+
289+
# Install dependencies (mkdocs, plugins, mike, etc.)
290+
pip install --user -r hack/mkdocs/image/requirements.txt
291+
pip install --user mike
292+
293+
# Build the static site into 'site/'
294+
python -m mkdocs build --site-dir site
295+
296+
$(MIKE_BIN) deploy --update-aliases $(VERSION) $(ALIAS) site docs
297+
$(MIKE_BIN) set-default $(ALIAS) docs
298+
299+
@echo "Site built in site/, versions written to docs/"
282300

283301
.PHONY: live-docs
284302
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)