]> sipb.mit.edu Git - ikiwiki.git/commitdiff
revert destpage part of f7bdc2385
authorJoey Hess <joey@kodama.kitenet.net>
Mon, 24 Mar 2008 00:01:26 +0000 (20:01 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Mon, 24 Mar 2008 00:01:26 +0000 (20:01 -0400)
destpage does not normally need to be worried about when creating other files
as part of the process of rendering a page. Using destpage results in
inlined pages creating two copies of such files. It works to not use destpage
in this case because the inlining page depends on the source page, so if the
source page is modified or deleted the inlining page will be updated.

IkiWiki/Plugin/graphviz.pm
IkiWiki/Plugin/img.pm
IkiWiki/Plugin/linkmap.pm
IkiWiki/Plugin/sparkline.pm
IkiWiki/Plugin/teximg.pm

index ec48bad2c859fef49b87cce9f249113d3875a8d3..fe3559857a211807a133d9b95be05dafac5254b7 100644 (file)
@@ -29,10 +29,10 @@ sub render_graph (\%) { #{{{
        # Use the sha1 of the graphviz code as part of its filename.
        eval q{use Digest::SHA1};
        error($@) if $@;
        # Use the sha1 of the graphviz code as part of its filename.
        eval q{use Digest::SHA1};
        error($@) if $@;
-       my $dest=$params{destpage}."/graph-".
+       my $dest=$params{page}."/graph-".
                IkiWiki::possibly_foolish_untaint(Digest::SHA1::sha1_hex($src)).
                ".png";
                IkiWiki::possibly_foolish_untaint(Digest::SHA1::sha1_hex($src)).
                ".png";
-       will_render($params{destpage}, $dest);
+       will_render($params{page}, $dest);
 
        if (! -e "$config{destdir}/$dest") {
                my $pid;
 
        if (! -e "$config{destdir}/$dest") {
                my $pid;
index c5b86bad8311c42ca8c88993c9e55f62845ab988..b6e7c9e41db20db9639ec7927a2994a0560a799e 100644 (file)
@@ -39,7 +39,7 @@ sub preprocess (@) { #{{{
 
        my $file = bestlink($params{page}, $image);
 
 
        my $file = bestlink($params{page}, $image);
 
-       my $dir = $params{destpage};
+       my $dir = $params{page};
        my $base = IkiWiki::basename($file);
 
        eval q{use Image::Magick};
        my $base = IkiWiki::basename($file);
 
        eval q{use Image::Magick};
@@ -56,7 +56,7 @@ sub preprocess (@) { #{{{
                my $outfile = "$config{destdir}/$dir/${w}x${h}-$base";
                $imglink = "$dir/${w}x${h}-$base";
                
                my $outfile = "$config{destdir}/$dir/${w}x${h}-$base";
                $imglink = "$dir/${w}x${h}-$base";
                
-               will_render($params{destpage}, $imglink);
+               will_render($params{page}, $imglink);
 
                if (-e $outfile && (-M srcfile($file) >= -M $outfile)) {
                        $r = $im->Read($outfile);
 
                if (-e $outfile && (-M srcfile($file) >= -M $outfile)) {
                        $r = $im->Read($outfile);
index 5b87277ac1982f0dd73d5f4f06ad881e31d2c7f5..82b38f4cb79909c449e29bd8a68340db9d343bde 100644 (file)
@@ -53,11 +53,11 @@ sub genmap ($) { #{{{
                }
        }
 
                }
        }
 
-       my $dest=$params{destpage}."/linkmap.png";
+       my $dest=$params{page}."/linkmap.png";
 
        # Use ikiwiki's function to create the file, this makes sure needed
        # subdirs are there and does some sanity checking.
 
        # Use ikiwiki's function to create the file, this makes sure needed
        # subdirs are there and does some sanity checking.
-       will_render($params{destpage}, $dest);
+       will_render($params{page}, $dest);
        writefile($dest, $config{destdir}, "");
 
        # Run dot to create the graphic and get the map data.
        writefile($dest, $config{destdir}, "");
 
        # Run dot to create the graphic and get the map data.
@@ -86,7 +86,7 @@ sub genmap ($) { #{{{
        close OUT;
 
        local $/=undef;
        close OUT;
 
        local $/=undef;
-       my $ret="<object data=\"".urlto($dest, $params{page}).
+       my $ret="<object data=\"".urlto($dest, $params{destpage}).
               "\" type=\"image/png\" usemap=\"#linkmap$mapnum\">\n".
                <IN>.
                "</object>";
               "\" type=\"image/png\" usemap=\"#linkmap$mapnum\">\n".
                <IN>.
                "</object>";
index 0b9ddd8d2460e8ea175a603e710f77ca4589e9e0..69b3512c27e708d1155fab842e76b46b7dbff9f5 100644 (file)
@@ -114,10 +114,10 @@ sub preprocess (@) { #{{{
        # the base for its filename.
        eval q{use Digest::SHA1};
         error($@) if $@;
        # the base for its filename.
        eval q{use Digest::SHA1};
         error($@) if $@;
-       my $fn=$params{destpage}."/sparkline-".
+       my $fn=$params{page}."/sparkline-".
                IkiWiki::possibly_foolish_untaint(Digest::SHA1::sha1_hex($php)).
                ".png";
                IkiWiki::possibly_foolish_untaint(Digest::SHA1::sha1_hex($php)).
                ".png";
-       will_render($params{destpage}, $fn);
+       will_render($params{page}, $fn);
 
        if (! -e "$config{destdir}/$fn") {
                my $pid;
 
        if (! -e "$config{destdir}/$fn") {
                my $pid;
index f7fd91ddf2a7156934a0a6c71ee52b1f294bea01..0753a9a77dcd637267a00f24f35e14dd01a143cc 100644 (file)
@@ -70,10 +70,10 @@ sub create ($$$) { #{{{
 
        my $digest = md5_hex($code, $height);
 
 
        my $digest = md5_hex($code, $height);
 
-       my $imglink= $params->{destpage} . "/$digest.png";
-       my $imglog =  $params->{destpage} .  "/$digest.log";
-       will_render($params->{destpage}, $imglink);
-       will_render($params->{destpage}, $imglog);
+       my $imglink= $params->{page} . "/$digest.png";
+       my $imglog =  $params->{page} .  "/$digest.log";
+       will_render($params->{page}, $imglink);
+       will_render($params->{page}, $imglog);
 
        my $imgurl=urlto($imglink, $params->{destpage});
        my $logurl=urlto($imglink, $params->{destpage});
 
        my $imgurl=urlto($imglink, $params->{destpage});
        my $logurl=urlto($imglink, $params->{destpage});