From ea6cb36fc44f8b21cc96bca6a3227efd0f87636d Mon Sep 17 00:00:00 2001 From: Rhiannon Morris Date: Sat, 18 Jul 2020 11:44:30 +0200 Subject: [PATCH] automate inkscape --- Makefile | 27 +++++++++++++++++++++++++-- style/18_plus.png | 3 --- style/18_plus_small.png | 3 --- 3 files changed, 25 insertions(+), 8 deletions(-) delete mode 100644 style/18_plus.png delete mode 100644 style/18_plus_small.png diff --git a/Makefile b/Makefile index 5f83f43..11c6846 100644 --- a/Makefile +++ b/Makefile @@ -12,12 +12,18 @@ MAKEPAGES = $(TMPDIR)/make-pages YAMLS != find $(DATADIR) -name $(INFONAME) SCRIPTS := $(wildcard script/*.js) -STYLES := $(wildcard style/*.css style/*.png) + +STYLES := $(wildcard style/*.css) +STYLESVGS = $(wildcard style/*.svg) +STYLEPNGS = $(wildcard style/*.png) \ + $(STYLESVGS:.svg=.png) $(STYLESVGS:.svg=_small.png) + FONTS := $(shell find fonts \ -iname '*.eot' -or -iname '*.svg' -or \ -iname '*.ttf' -or -iname '*.woff' -or \ -iname '*.woff2' -or -iname '*.css') -STATIC := $(SCRIPTS) $(STYLES) $(FONTS) + +STATIC := $(SCRIPTS) $(STYLES) $(STYLEPNGS) $(STYLESVGS) $(FONTS) BSTATIC := $(patsubst %,$(BUILDDIR)/%,$(STATIC)) all: make-pages $(BUILDDIR)/index.html $(BSTATIC) @@ -27,6 +33,23 @@ $(BUILDDIR)/%: % mkdir -p $(dir $@) cp $< $@ +$(BUILDDIR)/%: $(TMPDIR)/% + echo "[copy] "$@ + mkdir -p $(dir $@) + cp $< $@ + +define inkscape = +echo "[svg] "$@ +mkdir -p $(dir $@) +inkscape $< -e $@ -w $(1) >/dev/null +endef + +$(TMPDIR)/%.png: %.svg + $(call inkscape,32) + +$(TMPDIR)/%_small.png: %.svg + $(call inkscape,16) + $(BUILDDIR)/index.html: $(DATADIR)/galleries.yaml $(MAKEPAGES) echo "[index]" mkdir -p $(dir $@) diff --git a/style/18_plus.png b/style/18_plus.png deleted file mode 100644 index c188387..0000000 --- a/style/18_plus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d0bec721554cb764137c9e561aa5d984a277a211c335035e8e603fe60daacaa1 -size 1713 diff --git a/style/18_plus_small.png b/style/18_plus_small.png deleted file mode 100644 index e53c5cd..0000000 --- a/style/18_plus_small.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:87a67ec981dc6f801bbcb20a0838d873c00c8fc5f859d4074fb682cc41521077 -size 722