feed generation
[scpubgit/SCS.git] / lib / SCSite / Page.pm
CommitLineData
ebd4c292 1package SCSite::Page;
2
3use IO::All;
4use Moo;
5
34597fb2 6has $_ => (is => 'ro') for qw(title description keywords body created path);
ebd4c292 7
34597fb2 8has "_$_" => (is => 'ro', init_arg => $_) for qw(page_set);
ebd4c292 9
10sub 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
241;