Makefile: add preview target

Add a preview target for hosting a full preview of the site on an
external server. Target files are written to _preview/ instead of
_site/.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
This commit is contained in:
Gerwin Klein 2025-06-25 09:13:04 +10:00
parent bb1ab78343
commit b3b0657858
No known key found for this signature in database
GPG Key ID: 20A847CE6AB7F5F3
3 changed files with 18 additions and 4 deletions

1
.gitignore vendored
View File

@ -3,6 +3,7 @@
_data/generated.yml
_site/
_preview/
.sass-cache/
_repos/
projects/virtualization/docs/api/

View File

@ -102,16 +102,24 @@ docker_build:
# --host 0.0.0.0 serves on all interfaces, so that docker can export
# the connection; also works locally
serve: build
.PHONY: serve
serve: generate
JEKYLL_ENV=$(JEKYLL_ENV) bundle exec jekyll serve
build: generate_api ruby_deps microkit-tutorial $(REPOSITORIES)
$(MAKE) tutorials
.PHONY: generate
generate: generate_api ruby_deps microkit-tutorial tutorials $(REPOSITORIES)
ifeq ($(JEKYLL_ENV),production)
$(MAKE) generate_data_files
endif
JEKYLL_ENV=$(JEKYLL_ENV) bundle exec jekyll build
.PHONY: build
build: generate
JEKYLL_ENV=$(JEKYLL_ENV) bundle exec jekyll build $(BUILD_OPTS)
.PHONY: preview
preview: JEKYLL_ENV := production
preview: BUILD_OPTS := --config "_config.yml,_preview.yml" $(BUILD_OPTS)
preview: build
clean:
rm -rf _site

5
_preview.yml Normal file
View File

@ -0,0 +1,5 @@
# Copyright 2025 Proofcraft Pty Ltd
# SPDX-License-Identifier: BSD-2-Clause
destination: _preview
baseurl: "/docsite"