X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/58141a0ebcdf3313a83af712b83f8acd1c08aa3b..b157754e994b46aacf5f34a1d87140a6e4acf121:/IkiWiki/Render.pm?ds=inline diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index d8bc5a9d9..3545df05a 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -98,7 +98,7 @@ sub genpage ($$$) { #{{{ 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++; } } @@ -198,22 +198,26 @@ sub render ($) { #{{{ 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; } } #}}}