From 2611b42c5d2f4302592b3f7957830e2966b0a524 Mon Sep 17 00:00:00 2001 From: la-ninpre Date: Thu, 19 Aug 2021 09:41:39 +0300 Subject: 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 } ``` --- art/thumbs.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/art/thumbs.sh b/art/thumbs.sh index 758b0a9..71be5b4 100755 --- a/art/thumbs.sh +++ b/art/thumbs.sh @@ -30,7 +30,11 @@ do [ -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##*.}" -- cgit v1.2.3