source := content output := pdf sources := $(wildcard $(source)/*.md) objects := $(patsubst %.md,%.pdf,$(subst $(source),$(output),$(sources))) all: hugo $(objects) $(output)/%.pdf: $(source)/%.md chromium --temp-profile --headless --disable-gpu --run-all-compositor-stages-before-draw --allow-file-access-from-files --allow-running-insecure-content --print-to-pdf-no-header --print-to-pdf="$@" "public/print/$(notdir $(basename $@))/print.html" .PHONY : clean hugo deploy clean: rm -rf pdf/ public/ hugo: hugo mkdir -p pdf deploy: scp -r public/* dario@ghostdub.de:~/www-data/rezepte/ scp pdf/*.pdf dario@ghostdub.de:~/www-data/rezepte/print/