sidebar filter
[scpubgit/SCS.git] / lib / SCSite / Page.pm
index a0e5c15..cba4d6a 100644 (file)
@@ -8,12 +8,17 @@ has $_ => (is => 'ro') for qw(title description keywords body created path);
 has "_$_" => (is => 'ro', init_arg => $_) for qw(page_set);
 
 sub children {
-  my ($self) = @_;
+  my ($self, %args) = @_;
+  if (my $at = delete $args{at_depth}) {
+warn "Here, $at";
+    @args{qw(min_depth max_depth)} = ($at-1, $at);
+  }
   my $ps = $self->_page_set;
   (ref $ps)->new(
     top_dir => $ps->base_dir,
     base_dir => io->dir($ps->base_dir)->catdir($self->path),
-    max_depth => 1
+    max_depth => 1,
+    %args,
   );
 }