summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: b4f36a2ffbef3ac70b89777f4c95a37721e08f89 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
MODS = $(shell git submodule | awk '{print $$2}')

build: fmt ${MODS} static/resume.png
	hugo build
	find public -name '*.html' -exec tidy -mqi {} \;

fmt:
	gotmplfmt -w .

publish: build
	rsync -rz --delete public/ samanthony.xyz:/var/www/htdocs/samanthony.xyz/
	$(eval CID := $(shell ipfs add -r public | tail -n1 | awk '{print $$2}')) \
	ssh m900 "IPFS_PATH=/var/kubo ipfs pin add -r ${CID}"
	ipfs name publish --key=www.samanthony.xyz ${CID}

serve: build
	hugo serve -DEF

clean:
	rm -rf public

static/resume.png: static/resume.pdf
	gs -dNOPAUSE -dBATCH -sDEVICE=png16m -r300 -sOutputFile=$@ $<

${MODS}:
	git submodule update --init --recursive

.PHONY: build fmt publish serve clean