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