Skip to content

Commit

Permalink
compress images
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHicks committed Dec 28, 2020
1 parent 714ba71 commit f22cb1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions default.nix
Expand Up @@ -12,6 +12,7 @@ in pkgs.stdenv.mkDerivation {
pkgs.nodePackages.html-minifier
pkgs.nodePackages.clean-css-cli
pkgs.nodePackages.uglify-js
pkgs.pngcrush
];
buildPhase = ''
zola build
Expand Down Expand Up @@ -41,6 +42,9 @@ in pkgs.stdenv.mkDerivation {
--file-ext html \
--input-dir public \
--output-dir public
echo "compressing images"
find public -type f -name '*.png' | xargs -n 1 pngcrush -ow -brute
'';

installPhase = ''
Expand Down
2 changes: 1 addition & 1 deletion shell.nix
Expand Up @@ -7,5 +7,5 @@ let
in with nixpkgs;
stdenv.mkDerivation {
name = "bytes.zone";
buildInputs = [ niv.niv git zola pa11y.pa11y ];
buildInputs = [ niv.niv git zola pa11y.pa11y pngcrush ];
}

0 comments on commit f22cb1c

Please sign in to comment.