-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
21 lines (15 loc) · 818 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
THIS_DIR := $(CURDIR)
PDFS = $(patsubst %.html,%.pdf,$(wildcard _site/*.html))
_site/: $(FILES)
bundle exec jekyll build
# Set the base_url to be an absolute directory so that CSS and assets load properly
_pdfs/:
bundle exec jekyll build -b "file:///${THIS_DIR}/_pdfs/" -d _pdfs/
# Sigh, render the page twice with different margins and then combine the first page
# and the other pages together to make a pretty PDF. Requires wkhtmltopdf and PdfToolkit
_site/%.pdf: _pdfs/%.html _pdfs/
-wkhtmltopdf --disable-external-links -B 2cm -L 0mm -R 0mm -T 0mm --print-media-type --page-size A4 $< [email protected]; \
wkhtmltopdf --disable-external-links -B 2cm -L 0mm -R 0mm -T 2cm --print-media-type --page-size A4 $< [email protected]; \
pdftk [email protected] [email protected] cat T1 R2-end output $@; \
build: _site/ $(PDFS)