]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/linkmap.pm
* Use forcebaseurl to make page previews be displayed with the html base
[ikiwiki.git] / IkiWiki / Plugin / linkmap.pm
index 0a8d0ca9a1bfc20e84251638ae8628036bd20ee3..5b87277ac1982f0dd73d5f4f06ad881e31d2c7f5 100644 (file)
@@ -3,7 +3,7 @@ package IkiWiki::Plugin::linkmap;
 
 use warnings;
 use strict;
-use IkiWiki;
+use IkiWiki 2.00;
 use IPC::Open2;
 
 sub import { #{{{
@@ -48,21 +48,21 @@ sub genmap ($) { #{{{
        # Get all the items to map.
        my %mapitems = ();
        foreach my $item (keys %links) {
-               if (pagespec_match($item, $params{pages}, $params{page})) {
+               if (pagespec_match($item, $params{pages}, location => $params{page})) {
                        $mapitems{$item}=urlto($item, $params{destpage});
                }
        }
 
-       my $dest=$params{page}."/linkmap.png";
+       my $dest=$params{destpage}."/linkmap.png";
 
        # Use ikiwiki's function to create the file, this makes sure needed
        # subdirs are there and does some sanity checking.
-       will_render($params{page}, $dest);
+       will_render($params{destpage}, $dest);
        writefile($dest, $config{destdir}, "");
 
        # Run dot to create the graphic and get the map data.
        my $pid;
-       my $sigpipe=0;;
+       my $sigpipe=0;
        $SIG{PIPE}=sub { $sigpipe=1 };
        $pid=open2(*IN, *OUT, "dot -Tpng -o '$config{destdir}/$dest' -Tcmapx");