1 package Moose::Website;
3 use MooseX::Types::Path::Class;
6 use YAML::XS 'LoadFile';
7 use Moose::Website::I18N;
10 our $AUTHORITY = 'cpan:STEVAN';
12 with 'MooseX::Getopt';
16 isa => 'Path::Class::File',
23 isa => 'Path::Class::Dir',
28 has 'template_root' => (
30 isa => 'Path::Class::Dir',
35 has 'template_config' => (
39 default => sub { +{} },
45 default => sub { 'en' },
56 Moose::Website::I18N->get_handle( $self->locale )
61 traits => [ 'NoGetopt' ],
63 isa => 'ArrayRef[HashRef]',
67 LoadFile( $self->page_file->stringify );
72 traits => [ 'NoGetopt' ],
79 INCLUDE_PATH => $self->template_root,
80 %{ $self->template_config }
85 sub log { shift; warn @_, "\n" }
90 foreach my $page ( @{ $self->pages } ) {
93 $self->build_template_params( current_page => $page ),
94 $self->outdir->file( $page->{outfile} )->stringify
95 ) || confess $self->tt->error;
99 sub build_template_params {
100 my ($self, %params) = @_;
102 $params{ pages } = $self->pages;
103 $params{ loc } = sub { $self->i18n->loc( @_ ) };
109 __PACKAGE__->meta->make_immutable;
119 Moose::Website - A Moosey solution to this problem
137 All complex software has bugs lurking in it, and this module is no
138 exception. If you find a bug please either email me, or add the bug
143 Stevan Little E<lt>stevan.little@iinteractive.comE<gt>
145 =head1 COPYRIGHT AND LICENSE
147 Copyright 2010 Infinity Interactive, Inc.
149 L<http://www.iinteractive.com>
151 This library is free software; you can redistribute it and/or modify
152 it under the same terms as Perl itself.