more robust compression
This commit is contained in:
17
scripts/Makefile.static
Normal file
17
scripts/Makefile.static
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
SRCS = $(wildcard *.html *.xml *.txt *.css *.map *.pdf)
|
||||||
|
|
||||||
|
ZSTD = $(patsubst %,%.zst,$(SRCS))
|
||||||
|
BR = $(patsubst %,%.br,$(SRCS))
|
||||||
|
GZ = $(patsubst %,%.gz,$(SRCS))
|
||||||
|
|
||||||
|
.PHONY: all
|
||||||
|
all: $(ZSTD) $(BR) $(GZ)
|
||||||
|
|
||||||
|
%.br: %
|
||||||
|
brotli $<
|
||||||
|
|
||||||
|
%.zst: %
|
||||||
|
zstd -19 $<
|
||||||
|
|
||||||
|
%.gz: %
|
||||||
|
zopfli $<
|
||||||
@@ -4,13 +4,4 @@ cd "$(git rev-parse --show-toplevel)"
|
|||||||
|
|
||||||
hugo --cleanDestinationDir --printPathWarnings --panicOnWarning
|
hugo --cleanDestinationDir --printPathWarnings --panicOnWarning
|
||||||
|
|
||||||
find public \
|
find public -type d | xargs -P4 -n1 make -j4 -sf $PWD/scripts/Makefile.static -C
|
||||||
-name '*.html' -or \
|
|
||||||
-name '*.xml' -or \
|
|
||||||
-name '*.txt' -or \
|
|
||||||
-name '*.css' -or \
|
|
||||||
-name '*.map' -or \
|
|
||||||
-name '*.pdf' | \
|
|
||||||
tee >(xargs -n1 -P$(nproc) zopfli) | \
|
|
||||||
tee >(xargs -n1 -P$(nproc) zstd -19) | \
|
|
||||||
xargs -n1 -P$(nproc) brotli
|
|
||||||
|
|||||||
Reference in New Issue
Block a user