From: intrigeri Date: Sun, 13 Jul 2008 12:51:20 +0000 (+0200) Subject: pedigree: fixed misc bugs X-Git-Tag: 2.54~70^2~8 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=16cf69477d9511debba84152629d9f08a6e643a5;p=ikiwiki.git pedigree: fixed misc bugs Signed-off-by: intrigeri --- diff --git a/IkiWiki/Plugin/pedigree.pm b/IkiWiki/Plugin/pedigree.pm index efe6c3e77..b051a6da2 100644 --- a/IkiWiki/Plugin/pedigree.pm +++ b/IkiWiki/Plugin/pedigree.pm @@ -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;