From 6e51720cb63c49c055c2c6f7c793e0ceec02f4f8 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Mon, 12 Jun 2023 11:46:07 +0100 Subject: [PATCH] mason/.perl-lib/TrivGal.pm: Introduce a `-' flag to hide an entry. This is only useful if the entry is /also/ an index: it allows an index page to designate an image that's in a different folder. --- mason/.perl-lib/TrivGal.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mason/.perl-lib/TrivGal.pm b/mason/.perl-lib/TrivGal.pm index b47835a..80cce08 100644 --- a/mason/.perl-lib/TrivGal.pm +++ b/mason/.perl-lib/TrivGal.pm @@ -304,12 +304,13 @@ sub listdir ($) { } else { if ($item && $comment) { $item->comment($comment); } my ($flags, $name, $c) = - /^ (?: ([!]+) \s+)? # flags + /^ (?: ([-!]+) \s+)? # flags (\S+) \s* # filename (\S | \S.*\S )? # start of the comment \s* $/x; my $indexp = $flags =~ /!/; + my $hidep = $flags =~ /-/; $name = urldecode $name; my $list; $item = TrivGal::Item->new($name); @@ -326,7 +327,7 @@ sub listdir ($) { } } $comment = $c; - push @$list, $item; + push @$list, $item unless $hidep; } } if ($item && $comment) { $item->comment($comment); } -- 2.11.0