Files: 33f0213d37fc0591148824bb3a792e0b8cba2376 / Makefile
1251 bytesRaw
1 | .PHONY: lint check-publish publish serve |
2 | |
3 | output: $(shell find content static) .cache/generator .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 | lint: .cache/lint |
20 | |
21 | .cache/lint: $(shell find static/style) |
22 | toolbox run npx -y prettier -w static/style/tarazed.css |
23 | touch $@ |
24 | |
25 | check-publish: |
26 | ifeq "${SSHUSER}" "" |
27 | @echo "SSHUSER is undefined" |
28 | @exit 1 |
29 | else ifeq "${SSHPASS}" "" |
30 | @echo "SSHPASS is undefined" |
31 | @exit 1 |
32 | else ifeq "${SSHDIR}" "" |
33 | @echo "SSHDIR is undefined" |
34 | @exit 1 |
35 | else ifeq "${SSHPORT}" "" |
36 | @echo "SSHPORT is undefined" |
37 | @exit 1 |
38 | else ifneq "$(shell git status --porcelain)" "" |
39 | @echo "Uncommitted changes:" |
40 | @git status --porcelain |
41 | @exit 1 |
42 | endif |
43 | |
44 | publish: check-publish .cache/publish |
45 | |
46 | .cache/publish: output |
47 | echo -e "cd ${SSHDIR} \n put -r output/* \n exit" | \ |
48 | sshpass -e sftp -oBatchMode=no -b - sftp://${SSHUSER}@gkn.me.uk:${SSHPORT} |
49 | touch $@ |
50 | |
51 | serve: output |
52 | cd output && python -m http.server |
53 |
Built with git-ssb-web