From: Paul Hänsch Date: Fri, 7 Nov 2025 00:47:01 +0000 (+0100) Subject: some simplification due to better path-presentation in attachment_glob(), include... X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=719379e3d849e003176b02b52f0a474e7a502a4b;p=shellwiki some simplification due to better path-presentation in attachment_glob(), include avif and webp --- diff --git a/macros/gallery b/macros/gallery index edc6a39..17fbab7 100755 --- a/macros/gallery +++ b/macros/gallery @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright 2023 Paul Hänsch +# Copyright 2023, 2025 Paul Hänsch # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -29,19 +29,10 @@ for glob in "$@"; do acl_read "$(page_abs "${page}")" \ && attachment_glob "$glob" done \ -| grep -xiE '.*\.jpe?g|.*\.png|.*\.gif' \ +| grep -xiE '.*\.(jpe?g|png|gif|webp|avif)' \ | while read attachment; do - case $attachment in - */*) - printf '' \ - "$(URL "${attachment%/*}/[attachment]/${attachment##*/}")" \ - "$(URL "${attachment}")" - ;; - *) - printf '' \ - "$(URL "[attachment]/${attachment}")" \ - "$(URL "${attachment}")" - ;; - esac + printf '' \ + "$(HTML "${attachment%/*}/[attachment]/${attachment##*/}")" \ + "$(HTML "${attachment}")" done printf ''