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