automate inkscape

This commit is contained in:
Rhiannon Morris 2020-07-18 11:44:30 +02:00
parent 6b995248a3
commit ea6cb36fc4
3 changed files with 25 additions and 8 deletions

View file

@ -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 $@)

BIN
style/18_plus.png (Stored with Git LFS)

Binary file not shown.

BIN
style/18_plus_small.png (Stored with Git LFS)

Binary file not shown.