diff options
Diffstat (limited to 'lib/Crater/Gallery.rakumod')
-rw-r--r-- | lib/Crater/Gallery.rakumod | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Crater/Gallery.rakumod b/lib/Crater/Gallery.rakumod index ea92c47..19b0d69 100644 --- a/lib/Crater/Gallery.rakumod +++ b/lib/Crater/Gallery.rakumod @@ -3,13 +3,16 @@ class Crater::Gallery { method list() { my @gallery; - for dir($!directory).sort(*.modified) { + for $!directory.dir.sort(*.modified) { if .IO.d { } elsif .IO.f { my Str $ext = .extension.lc; if $ext eq "jpg"|"png" { - push @gallery, %( :type<img>, :src($_.relative($!directory)) ); + push @gallery, %( + :type<img>, :src($_.relative($!directory)), + :alt($_) + ); } elsif $ext eq "0" { push @gallery, %( :type<heading>, :text($_.slurp) ); } elsif $ext eq "txt" { @@ -19,7 +22,6 @@ class Crater::Gallery { } } } - return @gallery; } } |