tasiaiso.vulpecula.zone/Makefile

70 lines
1.5 KiB
Makefile

# $< : first dependency (input)
# $@ : rule name (output)
# Build the website
site/index.html: docs/** \
theme/** \
theme/main.html \
theme/style.min.css \
theme/gruvbox-dark.min.css \
mkdocs.yml
mkdocs build
build: site/index.html
# HTML
theme/main.html: haml/main.haml
haml render $< > $@.tmp
cat $@.tmp > $@
rm $@.tmp
# CSS
theme/style.min.css: theme/style.css
python3 -m csscompressor -o $@ $<
theme/gruvbox-dark.min.css: theme/gruvbox-dark.css
python3 -m csscompressor -o $@ $<
# Favicons
theme/favicon-ex.png: theme/favicon.svg
inkscape theme/favicon.svg --export-filename=theme/favicon-ex.png
theme/favicon.png: theme/favicon-ex.png
magick theme/favicon-ex.png -compress Zip -quality 1 -resize 144x144 theme/favicon.png
theme/favicon.ico: theme/favicon-ex.png
magick theme/favicon-ex.png -compress Zip -quality 1 -resize 144x144 theme/favicon.ico
favicon_all: theme/favicon.png theme/favicon.ico
# Scripts
# 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.min.css
rm theme/gruvbox-dark.min.css
rm theme/favicon-ex.png
rm theme/favicon.min.svg
rm theme/favicon.png
rm theme/favicon.ico