package SCSite::Page;

use IO::All;
use Moo;

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 $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
  );
}

1;
