Files
website/Makefile
T
2026-10-11 17:01:32 +02:00

29 lines
1.1 KiB
Makefile

OC ?= ../oc
# test server: the web share of barbel-lescar, mounted from the file manager (smb://barbel-lescar/web)
DEPLOY_DIR ?= /run/user/$(shell id -u)/gvfs/smb-share:server=barbel-lescar,share=web/oldcomputers
DEPLOY_URL ?= https://barbel.synology.me/oldcomputers/
.PHONY: content build check serve deploy
content: ## regenerate content/ and static/media/ from the extraction repo
python3 $(OC)/scripts/05_hugo.py --target $(CURDIR)
build: ## build the site into public/
rm -rf public
hugo --panicOnWarning --minify
check: build ## build, then verify every internal link and image
python3 tools/check_links.py public
serve: ## local preview on http://localhost:1313
hugo server
deploy: ## build, check, and copy public/ to DEPLOY_DIR (served at DEPLOY_URL)
rm -rf public
hugo --panicOnWarning --minify
python3 tools/check_links.py public
@test -d "$(dir $(DEPLOY_DIR))" || { echo "share not mounted: $(dir $(DEPLOY_DIR))"; exit 1; }
mkdir -p "$(DEPLOY_DIR)"
rsync -r --size-only --info=stats1 public/media/ "$(DEPLOY_DIR)/media/"
rsync -rc --delete --exclude=/media/ --info=stats1 public/ "$(DEPLOY_DIR)/"