use HTML::Zoom;
default_config(
- pages_dir => $FindBin::RealBin.'/pages',
+ pages_dir => $FindBin::RealBin.'/../pages',
+ layout_file => $FindBin::RealBin.'/../layout.html',
);
sub page {
dispatch [
sub (GET + /) { redispatch_to '/index.html' },
sub (GET + /**/) {
- redispatch_to do { my $x = join('/','',$_[1],'index.html'); warn $x; $x };
+ redispatch_to join('/','',$_[1],'index.html');
},
sub (.html) {
filter_response { $self->render_html($_[1]) }
sub _layout_html {
my $self = shift;
- my $file = $self->config->{pages_dir}.'/index.html';
+ my $file = $self->config->{layout_file};
if (-f $file) {
return do { local(@ARGV, $/) = ($file); <> }
} else {