URL generation for SubList
[scpubgit/SCS.git] / lib / SCSite / SubListFilter.pm
CommitLineData
ebd4c292 1package SCSite::SubListFilter;
2
3use Moo;
4
5with 'SCSite::Filter';
6
7sub _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
221;