Migrate to Makefile

master
Dario Ernst 4 years ago
parent 1582c6536d
commit a53ed59f83

@ -0,0 +1,17 @@
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
clean:
rm -rf pdf/ public/
hugo:
hugo
mkdir -p pdf

@ -18,7 +18,7 @@ servings: 4
- 15g Mehl
- 250g Tellerlinsen
- 2 Esslöffel Tomatenmark
- 12 Teelöffel getrockneter Majoran
- 1-2 Teelöffel getrockneter Majoran
- 1 Lorbeerblatt
- 1,2l Gemüse- oder Fleischbrühe
- 1-2 Esslöffel Balsamessig

@ -1,9 +0,0 @@
#!/bin/bash
rm -rf public/ pdf/
mkdir pdf
hugo
for dir in public/print/*
do
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="pdf/$(basename $dir).pdf" "${dir}/print.html"
done
Loading…
Cancel
Save