diff options
author | delta <darkussdelta@gmail.com> | 2025-02-03 22:58:46 +0100 |
---|---|---|
committer | delta <darkussdelta@gmail.com> | 2025-02-03 22:58:46 +0100 |
commit | 41a6d16ef6a356bc286b0eafe267d04aeed174f3 (patch) | |
tree | 86fe71416dc5f802bacec930f9afadd453824423 /.zs/posthook |
initial commit
Diffstat (limited to '.zs/posthook')
-rwxr-xr-x | .zs/posthook | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/.zs/posthook b/.zs/posthook new file mode 100755 index 0000000..bcf1d52 --- /dev/null +++ b/.zs/posthook @@ -0,0 +1,19 @@ +#!/bin/sh + +set -e + +minify_assets() { + p="$1" + t="$2" + + find "$p" -type f -name "*.$t" | while read -r file; do + name="${file#"$p"}" + name="${name#"/"}" + minify -o "${p}/${name}" "$file" + done +} + +if command -v minify > /dev/null; then + minify_assets "$ZS_OUTDIR" "css" + minify_assets "$ZS_OUTDIR" "js" +fi |