Add news posts with banner summaries on the home page
Posts live in content/post/; the five latest are summarised on the home page. Builds for check/deploy go to build/ so they do not collide with a running hugo server writing to public/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YDRjtmAiNpo5mK5N3d7QwZ
This commit is contained in:
@@ -1,28 +1,31 @@
|
||||
OC ?= ../oc
|
||||
# not public/: a running `hugo server` renders there, with its live-reload script
|
||||
BUILD ?= build
|
||||
# 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
|
||||
.PHONY: content build check serve deploy post
|
||||
|
||||
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
|
||||
build: ## build the site into $(BUILD)/
|
||||
rm -rf $(BUILD)
|
||||
hugo --panicOnWarning --minify -d $(BUILD)
|
||||
|
||||
check: build ## build, then verify every internal link and image
|
||||
python3 tools/check_links.py public
|
||||
python3 tools/check_links.py $(BUILD)
|
||||
|
||||
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
|
||||
post: ## new post: make post NAME=my-title, then edit content/post/<today>-my-title.md
|
||||
@test -n "$(NAME)" || { echo "usage: make post NAME=my-title"; exit 1; }
|
||||
hugo new content post/$(shell date +%F)-$(NAME).md
|
||||
|
||||
deploy: check ## build, check, and copy $(BUILD)/ to DEPLOY_DIR (served at DEPLOY_URL)
|
||||
@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)/"
|
||||
rsync -r --size-only --info=stats1 $(BUILD)/media/ "$(DEPLOY_DIR)/media/"
|
||||
rsync -rc --delete --exclude=/media/ --info=stats1 $(BUILD)/ "$(DEPLOY_DIR)/"
|
||||
|
||||
Reference in New Issue
Block a user