new index
[sdlgit/SDL-Site.git] / cgi-bin / sdl.cgi
index 4e1d4c8..b3c1579 100755 (executable)
@@ -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 {