# Use the sha1 of the graphviz code as part of its filename.
eval q{use Digest::SHA1};
error($@) if $@;
- my $dest=$params{page}."/graph-".
+ my $dest=$params{destpage}."/graph-".
IkiWiki::possibly_foolish_untaint(Digest::SHA1::sha1_hex($src)).
".png";
- will_render($params{page}, $dest);
+ will_render($params{destpage}, $dest);
if (! -e "$config{destdir}/$dest") {
my $pid;
}
}
- return "<img src=\"".urlto($dest, $params{page})."\" />\n";
+ if ($params{preview}) {
+ return "<img src=\"".urlto($dest, "")."\" />\n";
+ }
+ else {
+ return "<img src=\"".urlto($dest, $params{destpage})."\" />\n";
+ }
} #}}}
sub graph (@) { #{{{