summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 07465dc6d6ccd5eb0461b10ff0602a6af4ca8484 (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
MODS = $(shell git submodule | awk '{print $$2}')

all: fmt ${MODS}
	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

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

.PHONY: build fmt publish serve clean