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