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
|
||||||
@ -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…
Reference in new issue