From 4ce55d23b374ecad1ae9df60ed7f2acaf16ab33a Mon Sep 17 00:00:00 2001 From: Volpeon Date: Mon, 27 Dec 2021 10:59:12 +0100 Subject: Add thumbnail compression --- Makefile | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index d84b561..bec4677 100644 --- a/Makefile +++ b/Makefile @@ -112,11 +112,15 @@ out/%.xml: content/%.md .cache/meta/%.json $(FEED_TEMPLATES_SRC) metadata/*.yaml $(PANDOC_FILTERS) \ -o "$@" "$<" -out/%: content/% | out - $(info [COPY] $< -> $@) +out/%/thumbnail.png: content/%/thumbnail.png | out + $(info [THMB] $< -> $@) - mkdir -p $(@D) - cp "$<" "$@" + convert -thumbnail 360x200^ -gravity center -extent 360x200 "$<" png:- | pngquant -o "$@" - + +out/%/thumbnail.jpg: content/%/thumbnail.jpg | out + $(info [THMB] $< -> $@) + + convert -thumbnail 360x200^ -gravity center -extent 360x200 "$<" ppm:- | cjpeg -quality 80 > "$@" out/%.woff2: assets/fonts/%.ttf assets/fonts/glyphs.txt | out $(info [FONT] $< -> $@) @@ -132,6 +136,12 @@ out/%.css: assets/css/%.scss $(CSS_SRC) | out sass "$<" | ./node_modules/.bin/postcss --use postcss-csso autoprefixer --no-map > "$@" +out/%: content/% | out + $(info [COPY] $< -> $@) + + mkdir -p $(@D) + cp "$<" "$@" + .cache/meta: | .cache mkdir -p .cache/meta -- cgit v1.2.3-70-g09d2