diff options
| author | la-ninpre <leobrekalini@gmail.com> | 2022-04-19 00:24:23 +0300 |
|---|---|---|
| committer | la-ninpre <leobrekalini@gmail.com> | 2022-04-19 00:32:37 +0300 |
| commit | 8d962aabf74c42c3afdc38f2f85fa7b06fd04ef0 (patch) | |
| tree | e5054517b940e5c535a4c7282d7faa7b6462e794 /visual/thumbs.sh | |
| parent | 9f4b181b36418669462c0300c2e090d0f4547dc8 (diff) | |
| download | aaoth.xyz-8d962aabf74c42c3afdc38f2f85fa7b06fd04ef0.tar.gz aaoth.xyz-8d962aabf74c42c3afdc38f2f85fa7b06fd04ef0.zip | |
reimplement website using shell scripts
major change, i know. now i'm using ssg and rssg by roman zolotarev.
okay, well, not exactly. ssg is modified to generate pages for gemini
too. it's hard to maintain two different things simultaneously.
bye-bye jekyll!
Diffstat (limited to 'visual/thumbs.sh')
| -rwxr-xr-x | visual/thumbs.sh | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/visual/thumbs.sh b/visual/thumbs.sh deleted file mode 100755 index 3c1a633..0000000 --- a/visual/thumbs.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh -ex - -_img_dirs="$( find . -maxdepth 1 -type d | sed -e '1d' -e 's/^\.\///' )" -_thumb_size="835x" -_thumbs_dir="thumbs" -_force_render=0 - -usage() { - echo "usage: $0 [-f|--force]" -} - -[ -n "$1" ] && \ - case $1 in - -f|--force) - _force_render=1 - ;; - -h|--help) - usage - exit 0 - ;; - *) - usage - exit 1 - ;; - esac - -for dir in $_img_dirs -do - cd "./$dir" || exit 1 - - mkdir -p "$_thumbs_dir" - - _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##*.}" - _name="${_img%%.*}" - _thumb="./$_thumbs_dir/${_name}_thumb.${_ext}" - - [ "$_force_render" -eq 1 ] || [ ! -f "$_thumb" ] && \ - { - # when compressed, gifs look ugly, so just copy them - # i know this is bad, but i'll adress it later - [ "$_ext" = "gif" ] && \ - echo "copied $1 to $_thumb" && \ - cp "$_img" "$_thumb" && continue - - echo "creating thumbnail for $_name..." - convert "$_img" -resize "$_thumb_size" "$_thumb" - } - done - - cd ".." - -done - |
