1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-23 21:02:09 +00:00

CI: speed up static gzip+zopfli compression

Compress RSS feeds with fewer iterations since their files are larger.
This commit is contained in:
Rohan Kumar 2021-02-24 13:15:49 -08:00
parent 7077b37976
commit 76efbb8479
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479

View file

@ -13,7 +13,9 @@ GEMINI_RSYNC_DEST = $(USER):$(GEMINI_ROOT)
OUTPUT_DIR = public OUTPUT_DIR = public
RSYNCFLAGS += -rlvz --zc=zstd RSYNCFLAGS += -rlvz --zc=zstd
ZOPFLI_ITERATIONS=500 # max compression # max compression
ZOPFLI_ITERATIONS=500
ZOPFLI_ITERATIONS_LARGE=75
.PHONY: hugo .PHONY: hugo
hugo: clean hugo: clean
@ -63,9 +65,13 @@ test: lint-css hint-devserver check-links
.PHONY: build .PHONY: build
build: hugo build: hugo
# gzip_static + max zopfli compression # gzip_static + max zopfli compression + brotli_static
ifndef NO_STATIC ifndef NO_STATIC
find $(OUTPUT_DIR) -type f -name '*.html' -o -name '*.css' -o -name '*.xml' -o -name '*.txt' -o -name '*.asc' -o -name '*.webmanifest' -o -name "*.svg" \ # compress RSS feeds separately, with fewer iterations since they're bigger
find $(OUTPUT_DIR) -type f -name '*.xml' \
| grep -v gemini \
| xargs zopfli --i$(ZOPFLI_ITERATIONS_LARGE) --gzip
find $(OUTPUT_DIR) -type f -name '*.html' -o -name '*.css' -o -name '*.txt' -o -name '*.asc' -o -name '*.webmanifest' -o -name "*.svg" \
| grep -v gemini \ | grep -v gemini \
| xargs zopfli --i$(ZOPFLI_ITERATIONS) --gzip | xargs zopfli --i$(ZOPFLI_ITERATIONS) --gzip
find $(OUTPUT_DIR) -type f -name '*.html' -o -name '*.css' -o -name '*.xml' -o -name '*.txt' -o -name '*.asc' -o -name '*.webmanifest' -o -name "*.svg" \ find $(OUTPUT_DIR) -type f -name '*.html' -o -name '*.css' -o -name '*.xml' -o -name '*.txt' -o -name '*.asc' -o -name '*.webmanifest' -o -name "*.svg" \