git ssb

0+

Grey the earthling / gkn.me.uk



Tree: 8e0d7e643c647b11a09fa74cf75bd78b828004c6

Files: 8e0d7e643c647b11a09fa74cf75bd78b828004c6 / Makefile

1617 bytesRaw
1.PHONY: lint clean check-publish publish serve
2
3output: $(shell find content static) .cache/generator .cache/fonts .cache/lint
4 python generator/generate.py
5 touch $@
6
7.cache/generator: $(shell find generator) .cache/deps
8 python -m black .
9 touch $@
10
11.cache/deps: Makefile
12 toolbox run echo || toolbox -y create
13 toolbox run sh -c 'which npx || sudo dnf -y install npm'
14 toolbox run sh -c 'which pip || sudo dnf -y install pip'
15 toolbox run pip install black
16 toolbox run pip install beautifulsoup4==4.9.3
17 toolbox run pip install marko==1.1.0
18 toolbox run pip install python-frontmatter==1.0.0
19 mkdir -p .cache
20 touch $@
21
22.cache/fonts: $(shell find ~/Software/src/Iosevka/dist/*/woff2/) ~/Software/src/smol-emoji/SmolEmoji-Regular.otf
23 touch $@
24
25lint: .cache/lint
26
27.cache/lint: $(shell find static/style) .cache/deps
28 toolbox run npx -y prettier -w static/style/tarazed.css
29 touch $@
30
31clean: .cache/clean
32
33.cache/clean: $(shell find output/*)
34 rm -r output
35 touch $@
36
37check-publish:
38ifeq "${SSHUSER}" ""
39 @echo "SSHUSER is undefined"
40 @exit 1
41else ifeq "${SSHPASS}" ""
42 @echo "SSHPASS is undefined"
43 @exit 1
44else ifeq "${SSHDIR}" ""
45 @echo "SSHDIR is undefined"
46 @exit 1
47else ifeq "${SSHPORT}" ""
48 @echo "SSHPORT is undefined"
49 @exit 1
50else ifneq "$(shell git status --porcelain)" ""
51 @echo "Uncommitted changes:"
52 @git status --porcelain
53 @exit 1
54endif
55
56publish: clean check-publish .cache/publish
57
58.cache/publish: output
59 echo -e "cd ${SSHDIR} \n put -r output/* \n exit" | \
60 sshpass -e sftp -oBatchMode=no -b - sftp://${SSHUSER}@gkn.me.uk:${SSHPORT}
61 touch $@
62
63serve: output
64 cd output && python -m http.server
65

Built with git-ssb-web