all repos — website @ d484c4b09faf96a4717b0dec89f397d5119e600e

My website

Use make only for necessary functionality
Alan Pearce alan@alanpearce.eu
Sat, 16 Sep 2023 15:38:08 +0200
commit

d484c4b09faf96a4717b0dec89f397d5119e600e

parent

69603c41527237d2404569b41e110da6633f592f

1 files changed, 8 insertions(+), 22 deletions(-)

jump to
M MakefileMakefile
@@ -2,38 +2,30 @@ .SHELLFLAGS := -eu -o pipefail -c .ONESHELL:
 .DELETE_ON_ERROR:
 
-PREFIX ?= public
-
-md_files := $(shell fd . content --type=file -e md)
 brotli := @brotli --force --no-copy-stat
 gzip := @gzip --best --keep --force
 zstd := @zstd --force --no-pass-through -19 --quiet --stdout
 pr   := @printf "%4s %s\n"
 
-build: $(PREFIX)/index.html
-
-$(PREFIX)/index.html: config.toml $(md_files)
-	zola build --force --output-dir $(PREFIX)
-
-$(PREFIX)/feed-styles.xsl: $(PREFIX)/index.html
-	mv $(PREFIX)/feed-styles/index.html $@
-	rm -fr $(PREFIX)/feed-styles
+public/feed-styles.xsl: public/index.html
+	@mv public/feed-styles/index.html $@
+	@rm -fr public/feed-styles
 
-postprocess: $(PREFIX)/feed-styles.xsl
+postprocess: public/feed-styles.xsl
 	touch .postprocessstamp
 
 format: .formatstamp
 
-.formatstamp: $(PREFIX)/index.html .postprocessstamp
+.formatstamp: public/index.html .postprocessstamp
 	@echo "Formatting HTML..."
-	@prettier --write --parser html --print-width 200 "$(PREFIX)/**/*.html" > /dev/null
+	@prettier --write --parser html --print-width 200 "public/**/*.html" > /dev/null
 	@touch .formatstamp
 
 clean:
-	rm -rf ./$(PREFIX)
+	rm -rf ./public
 	rm -rf ./.*stamp
 
-to_compress := $(shell fd . $(PREFIX) --type=file -e html -e xml -e txt -e asc)
+to_compress := $(shell fd . public --type=file -e html -e xml -e txt -e asc)
 brotli_files := $(patsubst %, %.br, $(to_compress))
 gzip_files := $(patsubst %, %.gz, $(to_compress))
 zstd_files := $(patsubst %, %.zst, $(to_compress))
@@ -90,11 +82,5 @@ .compressstamp: .formatstamp $(brotli_files) $(gzip_files) $(zstd_files)
 	@echo "Compressing output files..."
 	@touch .compressstamp
-
-deploy: .deploystamp
-
-.deploystamp: .compressstamp Caddyfile redis.Caddyfile Dockerfile fly.toml
-	fly deploy
-	@touch .deploystamp
 
 .PHONY: all clean build format compress deploy