-
Notifications
You must be signed in to change notification settings - Fork 0
/
render.sh
executable file
·38 lines (28 loc) · 1.06 KB
/
render.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash -e
# This repo uses Bash as a template language to fill in the data index.html and README.md.
# index.html is then used to generate the PDF version.
if [[ $1 = install ]]; then
INSTALL=true
fi
if [[ $1 = force ]]; then
FORCE=true
fi
# HTML
if [[ $FORCE || include.sh -nt index.html || index.html.sh -nt index.html || data.yaml -nt index.html ]]; then
echo "Generating index.html..."
./index.html.sh
fi
# Markdown
if [[ $FORCE || README.template.html -nt README.html || include.sh -nt README.md || README.md.sh -nt README.md || data.yaml -nt README.md ]]; then
echo "Generating README.md..."
./README.md.sh
fi
# PDF
if [[ $FORCE || css/index.css -nt joehillen-resume.pdf || index.html -nt joehillen-resume.pdf ]]; then
echo "++ rendering joehillen-resume.pdf"
MARGIN=50px
QT_QPA_PLATFORM=offscreen wkhtmltopdf --allow . --title "Resume - Joe Hillenbrand" -T $MARGIN -R $MARGIN -B $MARGIN -L $MARGIN index.html joehillen-resume.pdf
fi
if [[ $INSTALL ]]; then
cp -r css/ index.html joehillen-resume.pdf README.html README.md /var/www/resume/
fi