X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSCSite%2FSubListFilter.pm;h=53489f352ddc020147029d333859367e06d6a3dc;hb=2a19b2a6a1d611d7fcc484fdc19ac16c340db5ac;hp=4246bd6dd33abdcc3c11bbf1ee92ef2a9eb59288;hpb=7460370d5f2db5cdaa8e30f41507877bc4f59c67;p=scpubgit%2FSCS.git diff --git a/lib/SCSite/SubListFilter.pm b/lib/SCSite/SubListFilter.pm index 4246bd6..53489f3 100644 --- a/lib/SCSite/SubListFilter.pm +++ b/lib/SCSite/SubListFilter.pm @@ -7,13 +7,17 @@ with 'SCSite::Filter'; sub _filter_stream { my ($self, $stream, $config, $page) = @_; my $max = $config->{max_entries}||undef; # explicit undef (not 0) + my %child = + map +(exists $config->{$_} ? ($_ => $config->{$_}) : ()), + qw(min_depth max_depth at_depth); $stream->select('.SubList') - ->repeat_content($page->children->latest($max)->map(sub { + ->repeat_content($page->children(%child)->latest($max)->map(sub { my $o = shift; sub { $_->select('.entry.title')->replace_content($o->title) + ->select('.entry.subtitle')->replace_content($o->subtitle) ->select('.entry.description')->replace_content($o->description) - ->select('.entry.created')->replace_content($o->created) + ->select('.entry.published_at')->replace_content($o->published_at) ->select('.entry.link')->set_attribute(href => $o->path); } }));