From 16cf69477d9511debba84152629d9f08a6e643a5 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sun, 13 Jul 2008 14:51:20 +0200 Subject: [PATCH] pedigree: fixed misc bugs Signed-off-by: intrigeri --- IkiWiki/Plugin/pedigree.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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; -- 2.26.2