Files
poweronoff.click/Makefile
T
morpheus b094ec91f3
Build and deploy the poweronoff.click hugo / build (push) Successful in 46s
Give project entries an image and a full description
Each project on the landing page is now a two-column entry: an image from the
project on the left, a long description on the right (stacked on mobile).

- data/projects.yaml: new required `image` (path in assets/), optional
  `image_alt`/`image_credit`, and `description` is now Markdown covering the
  idea and the technical implementation (~350 words, 1.5-2 min)
- assets/projects/berlin-crime-stories.jpg: the project's Kalle-und-Leni
  illustration, resized to 1100 px in the repo and processed by Hugo into an
  800 px WebP (36 KB) at build time
- shortcode renders the description with Page.RenderString (paragraphs, bold),
  resizes the image, and fails the build when name/url/description/image is
  missing or the asset does not exist (no nil-pointer panic)
- extend_head.html: new entry layout using PaperMod variables, responsive below
  720 px
- make check asserts an entry with image is rendered and the text covers both
  "Die Idee" and "Die Umsetzung"; AGENTS.md/README document the new fields

Berlin Crime Stories description covers the series concept, Kalle & Leni, the
Berlin locations, the DE/EN/RU multilingual setup, Hugo templates, tags/RSS,
theme, Turnstile + Cloudflare Worker contact form, Apache + CSP and cookieless
analytics.
2026-11-07 08:04:31 +01:00

65 lines
2.9 KiB
Makefile

# Local build helpers. The Hugo binary is not installed on the host: every
# target runs the official Docker image, same tag as CI (`latest`).
#
# `latest` moves without warning. To reproduce a build from an older point in
# time, override the image explicitly, e.g.:
# make check HUGO_IMAGE=ghcr.io/gohugoio/hugo:v0.169.0
HUGO_IMAGE ?= ghcr.io/gohugoio/hugo:latest
# --user keeps public/ owned by you instead of root (CI works around this with chmod).
DOCKER_RUN = docker run --rm \
-u "$(shell id -u):$(shell id -g)" \
-e HOME=/tmp \
-e HUGO_CACHEDIR=/tmp/hugo-cache \
-v "$(CURDIR)":/src \
-w /src
HUGO = $(DOCKER_RUN) $(HUGO_IMAGE)
.PHONY: help build serve check new-project clean theme-update
help: ## Show this help
@grep -hE '^[a-z-]+:.*?## ' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " %-14s %s\n", $$1, $$2}'
build: ## Build the production site into public/
@$(HUGO) --minify --gc --cleanDestinationDir
@echo "ok: public/"
serve: ## Preview on http://localhost:1313 (drafts included)
@$(DOCKER_RUN) -p 1313:1313 $(HUGO_IMAGE) server --bind 0.0.0.0 --port 1313 --buildDrafts --navigateToChanged
check: build ## Build, then verify the generated site
@test -f public/index.html
@test -f public/sitemap.xml
@test -f public/robots.txt
@test -f public/about/index.html
@test -f public/impressum/index.html
@test -f public/data_protection/index.html
@grep -q 'class=project' public/index.html \
|| { echo "FAIL: no project entries rendered (data/projects.yaml?)"; exit 1; }
@grep -q 'project-media' public/index.html \
|| { echo "FAIL: project entry is missing its image"; exit 1; }
@grep -q 'Die Idee' public/index.html && grep -q 'Die Umsetzung' public/index.html \
|| { echo "FAIL: project description must cover the idea and the implementation"; exit 1; }
@grep -q 'berlin-crime.poweronoff.click' public/index.html \
|| { echo "FAIL: Berlin Crime Stories missing from the landing page"; exit 1; }
@! grep -rl "Lorem Ipsum\|dolor sit amet\|TODO: body\.\|TODO: intro paragraph" public --include='*.html' \
|| { echo "FAIL: placeholder text found in public/"; exit 1; }
@! grep -rl "localhost:1313" public --include='*.html' \
|| { echo "FAIL: dev baseURL leaked into public/"; exit 1; }
@! grep -rl "github.com/poweronoff" public --include='*.html' \
|| { echo "FAIL: the author's GitHub profile must not be linked"; exit 1; }
@python3 scripts/check-links.py public
@echo "ok: site checks passed"
new-project: ## Show how to add a project
@echo 'Add an entry to data/projects.yaml (see the comment at the top), then run make check.'
clean: ## Remove build output and generated assets
@rm -rf public resources
@rm -f .hugo_build.lock
theme-update: ## Move the PaperMod submodule to its latest master commit
@git submodule update --remote themes/PaperMod
@git diff --submodule=log themes/PaperMod
@echo "Review the theme changelog, run 'make check', then commit the gitlink."