yams.media/build.sh
Roger Gonzalez d5b6cf585c
Add hugo cache directory
- Specifies a cache directory for hugo builds.
- Improves build performance by caching hugo assets.
- Sets the cache directory to $PWD/hugo-cache.
2025-05-14 21:26:43 -03:00

6 lines
311 B
Bash
Executable File

#!/bin/bash
find ./ -type f -name '*.png' -not -path '*/.git/*' -exec sh -c 'cwebp -lossless $1 -o "${1%.png}.webp"' _ {} \;
find . -type f -not -path '*/.git/*' -exec sed -i -e 's/\.png/\.webp/g' {} \;
hugo -s . -d /var/www/yams.media/ --minify --cleanDestinationDir --gc --verbose --cacheDir $PWD/hugo-cache