my $actions=0;
if (length $config{cgiurl}) {
- $template->param(editurl => cgiurl(do => "edit", page => $page));
+ $template->param(editurl => cgiurl(do => "edit", page => pagetitle($page, 1)));
$template->param(prefsurl => cgiurl(do => "prefs"));
if ($config{rcs}) {
$template->param(recentchangesurl => cgiurl(do => "recentchanges"));
if ($page !~ /.*\/\Q$discussionlink\E$/ &&
(length $config{cgiurl} ||
exists $links{$page."/".$discussionlink})) {
- $template->param(discussionlink => htmllink($page, $page, gettext("Discussion"), 1, 1));
+ $template->param(discussionlink => htmllink($page, $page, gettext("Discussion"), noimageinline => 1, forcesubpage => 1));
$actions++;
}
}
my @links;
while ($content =~ /(?<!\\)$config{wiki_link_regexp}/g) {
- push @links, titlepage($2);
+ push @links, linkpage($2);
}
if ($config{discussion}) {
# Discussion links are a special case since they're
my $srcfd=readfile($srcfile, 1, 1);
delete $depends{$file};
will_render($file, $file, 1);
- my $destfd=writefile($file, $config{destdir}, undef, 1, 1);
- my $blksize = 16384;
- my ($len, $buf, $written);
- while ($len = sysread $srcfd, $buf, $blksize) {
- if (! defined $len) {
- next if $! =~ /^Interrupted/;
- error("failed to read $srcfile: $!");
- }
- my $offset = 0;
- while ($len) {
- defined($written = syswrite OUT, $buf, $len, $offset)
- or error("failed to write $file: $!");
- $len -= $written;
- $offset += $written;
+ writefile($file, $config{destdir}, undef, 1, sub {
+ my $destfd=shift;
+ my $cleanup=shift;
+
+ my $blksize = 16384;
+ my ($len, $buf, $written);
+ while ($len = sysread $srcfd, $buf, $blksize) {
+ if (! defined $len) {
+ next if $! =~ /^Interrupted/;
+ error("failed to read $srcfile: $!", $cleanup);
+ }
+ my $offset = 0;
+ while ($len) {
+ defined($written = syswrite $destfd, $buf, $len, $offset)
+ or error("failed to write $file: $!", $cleanup);
+ $len -= $written;
+ $offset += $written;
+ }
}
- }
+ });
$oldpagemtime{$file}=time;
}
} #}}}
foreach my $file (keys %rendered, @del) {
next if $f eq $file;
my $page=pagename($file);
- if (pagespec_match($page, $depends{$p})) {
+ if (pagespec_match($page, $depends{$p}, $p)) {
debug(sprintf(gettext("rendering %s, which depends on %s"), $f, $page));
render($f);
$rendered{$f}=1;