Browse Source

Configurable compress cmd

master
Dennis Schwerdel 1 year ago
parent
commit
461c51807f
  1. 3
      config.sh
  2. 10
      rebuild.sh

3
config.sh

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

10
rebuild.sh

@ -23,10 +23,12 @@ git submodule update
zola build
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 '{}' \;
if [ "$COMPRESS_CMD" != "" ]; then
echo "Compressing files..."
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"

Loading…
Cancel
Save