about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2023-06-24 20:13:15 +0200
committerAlan Pearce2023-06-24 20:13:15 +0200
commite3cbf1423db26f2509603922277cfddcd87cbfdb (patch)
tree5c6b9c607a5e1171c6508b77f5a0943eb33961fc
parent6d4912537072135740864c88b27ee9fb41834f08 (diff)
downloadwebsite-e3cbf1423db26f2509603922277cfddcd87cbfdb.tar.lz
website-e3cbf1423db26f2509603922277cfddcd87cbfdb.tar.zst
website-e3cbf1423db26f2509603922277cfddcd87cbfdb.zip
Format HTML output with prettier
-rw-r--r--Makefile7
-rw-r--r--flake.nix1
2 files changed, 6 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index b5ed0a6..9dca674 100644
--- a/Makefile
+++ b/Makefile
@@ -13,6 +13,9 @@ build: $(PREFIX)
 $(PREFIX):
 	zola build --output-dir $(PREFIX)
 
+format: $(PREFIX)
+	prettier --write --parser html --print-width 200 "$(PREFIX)/**/*.html"
+
 clean:
 	rm -rf ./$(PREFIX)
 
@@ -61,7 +64,7 @@ compress: $(brotli_files) $(gzip_files) $(zstd_files)
 
 install: compress
 
-deploy: build compress
+deploy: build format compress
 	rsync --archive --delete public/ pappel.alanpearce.eu:/srv/http/alanpearce.eu
 
-.PHONY: all clean build compress install deploy
+.PHONY: all clean build format compress install deploy
diff --git a/flake.nix b/flake.nix
index 24f3297..9cf8588 100644
--- a/flake.nix
+++ b/flake.nix
@@ -23,6 +23,7 @@
 
             nativeBuildInputs = with pkgs; [
               zola
+              nodePackages_latest.prettier
               fd
               brotli
               gzip