URL generation for SubList
[scpubgit/SCS.git] / lib / SCSite / Page.pm
1 package SCSite::Page;
2
3 use IO::All;
4 use Moo;
5
6 has $_ => (is => 'ro') for qw(title description keywords body created path);
7
8 has "_$_" => (is => 'ro', init_arg => $_) for qw(page_set);
9
10 sub children {
11   my ($self) = @_;
12   my $ps = $self->_page_set;
13   (ref $ps)->new(
14     top_dir => $ps->base_dir,
15     base_dir => io->dir($ps->base_dir)->catdir($self->path),
16     max_depth => 1
17   );
18 }
19
20 1;