troop352.us/Makefile
2025-02-08 22:34:46 -06:00

24 lines
500 B
Makefile

IMG_SRC := $(wildcard *.jpg)
IMG_DST := $(IMG_SRC:%.jpg=build/%.jpg)
IMG_TAGS := $(patsubst %.jpg,<img src="%.jpg">,$(IMG_SRC))
.PHONY: all
all: build/index.html $(IMG_DST)
build/index.html: index.html | build
sed '/INSERT IMAGES HERE/c$(IMG_TAGS)' index.html > $@
build/%.jpg: %.jpg | build
magick $< -gravity center -crop 16:9 -resize 1920x1920 -quality 80 $@
build:
mkdir -p build
.PHONY: deploy
deploy: all
rsync -av build/ bert:/srv/www/troop352.us/
.PHONY: clean
clean:
rm -rf build