ICON_PNGS  := $(wildcard icons/*.png)
ICON_WEBPS := $(ICON_PNGS:.png=.webp)
WWW        := ~/working/object-publish/goto

.PHONY: local verify serve sync icons

local: $(WWW)/index.html $(WWW)/projects.html $(WWW)/internal.html icons
	@rsync -a icons favicon.ico $(WWW)/

$(WWW)/index.html: index.html style.css
	includer $(WWW) $^

$(WWW)/projects.html: projects.html projects.css
	includer $(WWW) $^

$(WWW)/internal.html: internal.html style.css
	includer $(WWW) $^

# development

icons: $(ICON_WEBPS)

icons/%.webp: icons/%.png
	magick $< -resize x120 $@

verify:
	@verify-links .

serve:
	@serve $(WWW)

# publish

sync: verify
	rsync -hav $(WWW)/ aspen:/mnt/ssd/hosts/web/goto/
