35 lines
1.1 KiB
Plaintext
35 lines
1.1 KiB
Plaintext
&root = .
|
|
&tmpl_dir = ./templates
|
|
&gen_tmpl_dir = ./build/templates
|
|
|
|
HTML_TEMPLATE = main.html
|
|
|
|
!html = | &(tmpl_dir)/<tmpl_group> \
|
|
|> ^b html %f^ \
|
|
pandoc --from markdown --to html \
|
|
--template=&(tmpl_dir)/$(HTML_TEMPLATE) \
|
|
--include-in-header=&(tmpl_dir)/header.html \
|
|
--include-before-body=&(tmpl_dir)/nav.html \
|
|
--css &(root)/css/style.css \
|
|
--include-after-body=&(gen_tmpl_dir)/footer.html \
|
|
%f | sed 's|%%webRoot%%|&(root)|g' > %o \
|
|
|> %B.html
|
|
|
|
# Images
|
|
!png = |> convert %f %o |> %B.png
|
|
!compress_png = |> zopflipng %f %o |>
|
|
!compress_jpg = |> cjpeg -quality 80 -progressive -outfile %o %f |>
|
|
!compress_pdf = |> ps2pdf %f %o |>
|
|
|
|
JPG_OPT = -quality 80 -strip -interlace Plane
|
|
!blur_mini = |> ^ %f -> blur mini^ convert %f -resize 400x400 -blur 0x8 $(JPG_OPT) %o |> blur_mini.jpg
|
|
!thumbnail = |> ^ %f -> thumbnail^ convert %f -resize 200x200 $(JPG_OPT) %o |>
|
|
|
|
#
|
|
# Slides
|
|
#
|
|
MARP = npx @marp-team/marp-cli@latest
|
|
MARP_OPTS = --allow-local-files --bespoke.progress
|
|
!marp_pdf = |> $(MARP) $(MARP_OPTS) %f --pdf --output %o |> %B.pdf
|
|
!marp_html = |> $(MARP) $(MARP_OPTS) %f --html --output %o |> %B.html
|