]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/parentlinks.pm
po(change): reset renamed pages status at a better time
[git.ikiwiki.info.git] / IkiWiki / Plugin / parentlinks.pm
index 890a349b597ed2b7193ece1738436c595bd6c05b..9095dabdaf176726b6a514e9edb605c8d06eb4e3 100644 (file)
@@ -7,9 +7,18 @@ use strict;
 use IkiWiki 2.00;
 
 sub import { #{{{
 use IkiWiki 2.00;
 
 sub import { #{{{
+       hook(type => "parentlinks", id => "parentlinks", call => \&parentlinks);
        hook(type => "pagetemplate", id => "parentlinks", call => \&pagetemplate);
 } # }}}
 
        hook(type => "pagetemplate", id => "parentlinks", call => \&pagetemplate);
 } # }}}
 
+sub getsetup () { #{{{
+       return 
+               plugin => {
+                       safe => 1,
+                       rebuild => 1,
+               },
+} #}}}
+
 sub parentlinks ($) { #{{{
        my $page=shift;
 
 sub parentlinks ($) { #{{{
        my $page=shift;
 
@@ -27,7 +36,7 @@ sub parentlinks ($) { #{{{
                $depth=$i;
                $height=($pagedepth - $depth);
                push @ret, {
                $depth=$i;
                $height=($pagedepth - $depth);
                push @ret, {
-                       url => urlto($path, $page),
+                       url => urlto(bestlink($page, $path), $page),
                        page => $title,
                        depth => $depth,
                        height => $height,
                        page => $title,
                        depth => $depth,
                        height => $height,
@@ -35,7 +44,7 @@ sub parentlinks ($) { #{{{
                        "height_$height" => 1,
                };
                $path.="/".$dir;
                        "height_$height" => 1,
                };
                $path.="/".$dir;
-               $title=IkiWiki::pagetitle($dir);
+               $title=pagetitle($dir);
                $i++;
        }
        return @ret;
                $i++;
        }
        return @ret;