]> sipb.mit.edu Git - ikiwiki.git/commitdiff
pedigree: fixed misc bugs
authorintrigeri <intrigeri@boum.org>
Sun, 13 Jul 2008 12:51:20 +0000 (14:51 +0200)
committerintrigeri <intrigeri@boum.org>
Sun, 13 Jul 2008 20:03:06 +0000 (22:03 +0200)
Signed-off-by: intrigeri <intrigeri@boum.org>
IkiWiki/Plugin/pedigree.pm

index efe6c3e770d8a560781f32ad7e2a4f7eccde0daf..b051a6da2f29bf59ab63d935e866042f8edb580f 100644 (file)
@@ -17,10 +17,10 @@ sub pedigree ($) { #{{{
        my @ret;
        my $path="";
        my $title=$config{wikiname};
-       my $i;
+       my $i=0;
 
        my @pagepath=(split("/", $page));
-       my $pageloc=@pagepath - 1;
+       my $pagedepth=@pagepath;
        foreach my $dir (@pagepath) {
                next if $dir eq 'index';
                push @ret, {
@@ -28,12 +28,12 @@ sub pedigree ($) { #{{{
                            page => $title,
                            level => $i,
                            is_root => ($i eq 0),
-                           is_first_child => ($i eq 1),
-                           is_mother => ($i eq ($pageloc - 1)),
-                           is_grand_mother => ($i eq ($pageloc - 2))
+                           is_second_ancestor => ($i eq 1),
+                           is_grand_mother => ($i eq ($pagedepth - 2)),
+                           is_mother => ($i eq ($pagedepth - 1)),
                           };
                $path.="/".$dir;
-               $title=pagetitle($dir);
+               $title=IkiWiki::pagetitle($dir);
                $i++;
        }
        return @ret;