Configurable compress cmd

This commit is contained in:
Dennis Schwerdel 2020-11-12 16:56:43 +01:00
parent 9023eb4aec
commit 461c51807f
2 changed files with 8 additions and 5 deletions

View File

@ -1,2 +1,3 @@
REPO_URL=""
REBUILD_INTERVAL=1d
COMPRESS_CMD="zopfli"

View File

@ -23,10 +23,12 @@ git submodule update
zola build
if [ "$COMPRESS_CMD" != "" ]; then
echo "Compressing files..."
find public -type f -name '*.css' -size +5k -exec zopfli '{}' \;
find public -type f -name '*.js' -size +5k -exec zopfli '{}' \;
find public -type f -name '*.html' -size +5k -exec zopfli '{}' \;
find public -type f -name '*.css' -size +5k -exec $COMPRESS_CMD '{}' \;
find public -type f -name '*.js' -size +5k -exec $COMPRESS_CMD '{}' \;
find public -type f -name '*.html' -size +5k -exec $COMPRESS_CMD '{}' \;
fi
echo "Updating webpage..."
mkdir -p "$WEB_PATH"