tasiaiso.vulpecula.zone/Makefile
2024-05-26 23:35:45 +02:00

45 lines
974 B
Makefile

# $< : first dependency (input)
# $@ : rule name (output)
# Build the website
site/index.html: docs/** theme/** theme/main.html theme/style.css.min theme/gruvbox-dark.css.min mkdocs.yml
mkdocs build
build: site/index.html
theme/main.html: haml/main.haml
haml render $< > $@.tmp
cat $@.tmp > $@
rm $@.tmp
theme/style.css.min: theme/style.css
python3 -m csscompressor -o $@ $<
theme/gruvbox-dark.css.min: theme/gruvbox-dark.css
python3 -m csscompressor -o $@ $<
# Serve the website at http://127.0.0.1:8000/~tasiaiso/
serve: theme/main.html
mkdocs serve -w theme
format: format-code format-markdown
format-code:
npx prettier --cache --write --check .
format-markdown:
npx markdownlint-cli 'docs/**/*.md' -f
# Upload the website to tilde.club
upload: build
scp -r site/** tasiaiso@tilde.club:/home/tasiaiso/public_html
purge: clean format build
.PHONY: clean
clean:
rm -r site/
rm theme/main.html
rm theme/style.css.min
rm theme/gruvbox-dark.css.min