my $path="";
my $title=$config{wikiname};
- return if $page eq 'index'; # toplevel
foreach my $dir (split("/", $page)) {
+ next if $dir eq 'index';
push @ret, { url => urlto($path, $page), page => $title };
$path.="/".$dir;
$title=pagetitle($dir);
return @ret;
} #}}}
-sub genpage ($$$) { #{{{
+sub genpage ($$) { #{{{
my $page=shift;
my $content=shift;
- my $mtime=shift;
my $templatefile;
run_hooks(templatefile => sub {
content => $content,
backlinks => $backlinks,
more_backlinks => $more_backlinks,
- mtime => displaytime($mtime),
+ mtime => displaytime($pagemtime{$page}),
baseurl => baseurl($page),
);
filter($page, $page,
readfile($srcfile)))));
- writefile(htmlpage($page), $config{destdir},
- genpage($page, $content, mtime($srcfile)));
+ my $output=htmlpage($page);
+ writefile($output, $config{destdir}, genpage($page, $content));
+ utime($pagemtime{$page}, $pagemtime{$page}, $config{destdir}."/".$output);
}
else {
my $srcfd=readfile($srcfile, 1, 1);
}
}
});
+ utime($pagemtime{$file}, $pagemtime{$file}, $config{destdir}."/".$file);
}
} #}}}
$content=preprocess($page, $page, $content);
$content=linkify($page, $page, $content);
$content=htmlize($page, $type, $content);
+ $pagemtime{$page}=mtime($srcfile);
- print genpage($page, $content, mtime($srcfile));
+ print genpage($page, $content);
exit 0;
} #}}}