From 719379e3d849e003176b02b52f0a474e7a502a4b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Fri, 7 Nov 2025 01:47:01 +0100 Subject: [PATCH] some simplification due to better path-presentation in attachment_glob(), include avif and webp --- macros/gallery | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) 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 '' -- 2.39.5