Commit | Line | Data |
---|---|---|
ebd4c292 | 1 | package SCSite::Page; |
2 | ||
3 | use IO::All; | |
4 | use Moo; | |
5 | ||
34597fb2 | 6 | has $_ => (is => 'ro') for qw(title description keywords body created path); |
ebd4c292 | 7 | |
34597fb2 | 8 | has "_$_" => (is => 'ro', init_arg => $_) for qw(page_set); |
ebd4c292 | 9 | |
10 | sub children { | |
fc436d2e | 11 | my ($self, %args) = @_; |
12 | if (my $at = delete $args{at_depth}) { | |
221c4151 | 13 | @args{qw(min_depth max_depth)} = ($at, $at); |
fc436d2e | 14 | } |
ebd4c292 | 15 | my $ps = $self->_page_set; |
16 | (ref $ps)->new( | |
34597fb2 | 17 | top_dir => $ps->base_dir, |
18 | base_dir => io->dir($ps->base_dir)->catdir($self->path), | |
fc436d2e | 19 | max_depth => 1, |
20 | %args, | |
ebd4c292 | 21 | ); |
22 | } | |
23 | ||
24 | 1; |