summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranck Cuny <franckcuny@gmail.com>2014-10-06 07:59:25 -0700
committerFranck Cuny <franckcuny@gmail.com>2014-10-06 07:59:29 -0700
commit3f0a9a1b500b81c986fafa7c224a4d17df62d505 (patch)
tree7493ececa36232482cf37cf4ea02d4f2e66f1c61
parentadd bsd license (diff)
downloadlumberjaph-3f0a9a1b500b81c986fafa7c224a4d17df62d505.tar.gz
Convert jpg and png to webp format
Closes #1
-rw-r--r--Makefile16
1 files changed, 15 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 656d515..d597d26 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,17 @@
+PNGS=$(shell find static -name "*.png")
+JPGS=$(shell find static -name "*.jpg")
+
+PNG2WEBP := $(patsubst %.png,%.webp,$(PNGS))
+JPG2WEBP := $(patsubst %.jpg,%.webp,$(JPGS))
+
+images: $(PNG2WEBP) $(JPG2WEBP)
+
+%.webp: %.png
+ cwebp -q 100 "$<" -o "$@"
+
+%.webp: %.jpg
+ cwebp -q 100 "$<" -o "$@"
+
build: clean
bundle exec jekyll build
@@ -7,7 +21,7 @@ clean:
server: clean
bundle exec jekyll server --port 3001 --watch --drafts
-publish: build
+publish: build images
rsync -chavzOP --stats _site/ /srv/www/lumberjaph.net/
deps: