X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=cgi-bin%2Fsdl.cgi;h=b3c157930a8a22098cf4c26b8638c07c91b12176;hb=1d5d4d44a3acf89f7820195b5016f4ebc4489250;hp=4e1d4c84f37de9e0f385d7c4d4af64188078562e;hpb=8f8a7adc65ea3eb5e319d45bf7848cf3c6cbdf14;p=sdlgit%2FSDL-Site.git diff --git a/cgi-bin/sdl.cgi b/cgi-bin/sdl.cgi index 4e1d4c8..b3c1579 100755 --- a/cgi-bin/sdl.cgi +++ b/cgi-bin/sdl.cgi @@ -11,7 +11,8 @@ package SDL_Perl::WebSite; use HTML::Zoom; default_config( - pages_dir => $FindBin::RealBin.'/pages', + pages_dir => $FindBin::RealBin.'/../pages', + layout_file => $FindBin::RealBin.'/../layout.html', ); sub page { @@ -27,7 +28,7 @@ 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]) } @@ -48,7 +49,7 @@ sub layout_zoom { 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 {