1
0
Fork 0
www/Makefile

28 lines
944 B
Makefile

.PHONY: *
help: ## display this help
@awk 'BEGIN{FS = ":.*##"; printf "\033[1m\nUsage\n \033[1;92m make\033[0;36m <target>\033[0m\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } ' $(MAKEFILE_LIST)
build: ## compile src/ into out/ with pagefind
./build.py out/
pagefind --site out/
clean: ## delete out/ and src/
test -e out && rm -rf out || true
test -e srv && rm -rf srv || true
watch: ## rebuild on changes
while inotifywait -r -e modify -e move -e create -e delete build.py Makefile src/; do make build; done
serve: ## serve out/
python -m http.server --directory out/
pubdate: ## Replace "pubdate: now" with the current date
sed -i "s/pubdate: now/pubdate: $$(date -Isec)/" src/blog/**/*.md
upload: ## build to srv/ and upload to www.alogoulogoi.com
test -e srv && rm -rf srv || true
./build.py srv/
pagefind --site srv/
rsync -av --delete srv/ ssh.alogoulogoi.com:/srv/www.alogoulogoi.com