Commit | Line | Data |
ebd4c292 |
1 | package SCSite::SubListFilter; |
2 | |
3 | use Moo; |
4 | |
5 | with 'SCSite::Filter'; |
6 | |
7 | sub _filter_stream { |
8 | my ($self, $stream, $config, $page) = @_; |
9 | my $max = $config->{max_entries}||undef; # explicit undef (not 0) |
10 | $stream->select('.SubList') |
11 | ->repeat_content($page->children->latest($max)->map(sub { |
12 | my $o = shift; |
13 | sub { |
14 | $_->select('.entry.title')->replace_content($o->title) |
15 | ->select('.entry.description')->replace_content($o->description) |
16 | ->select('.entry.created')->replace_content($o->created) |
34597fb2 |
17 | ->select('.entry.link')->set_attribute(href => $o->path); |
ebd4c292 |
18 | } |
19 | })); |
20 | } |
21 | |
22 | 1; |