fix thumbnail generation on every push
post-receive git hook is also tweaked. since thumbnails aren't needed on
site build time, they can be created after by copying `thumbs.sh` script
into site art directory, running it and deleting afterwards.
`hooks/post-receive`
```
{
cp "$TMP_GIT_CLONE/art/thumbs.sh" "$PUBLIC_WWW/art/thumbs.sh"
cd "$PUBLIC_WWW/art"
sh thumbs.sh
rm thumbs.sh
}
```
la-ninpre leobrekalini@gmail.com
Thu, 19 Aug 2021 09:41:39 +0300
1 files changed,
5 insertions(+),
1 deletions(-)
jump to
M
art/thumbs.sh
→
art/thumbs.sh
@@ -30,7 +30,11 @@ cd "./$dir" || exit 1
[ -d "$_thumbs_dir" ] || mkdir "$_thumbs_dir" - _imgs="$(find . -maxdepth 1 -type f | cut -b 3-)" + _imgs="$(find . -maxdepth 1 \ + -iname "*.jpg" -or \ + -iname "*.jpeg" -or \ + -iname "*.gif" -or \ + -iname "*.png" -type f | cut -b 3-)" for _img in $_imgs do _ext="${_img##*.}"