2 # -*- cperl-indent-level: 8; -*-
3 # Ikiwiki pedigree plugin.
4 package IkiWiki::Plugin::pedigree;
11 hook(type => "pagetemplate", id => "pedigree", call => \&pagetemplate);
14 sub pedigree ($) { #{{{
19 my $title=$config{wikiname};
22 my @pagepath=(split("/", $page));
23 my $pageloc=@pagepath - 1;
24 foreach my $dir (@pagepath) {
25 next if $dir eq 'index';
27 url => urlto($path, $page),
31 is_first_child => ($i eq 1),
32 is_mother => ($i eq ($pageloc - 1)),
33 is_grand_mother => ($i eq ($pageloc - 2))
36 $title=pagetitle($dir);
42 sub pagetemplate (@) { #{{{
44 my $page=$params{page};
45 my $template=$params{template};
47 if ($template->query(name => "pedigree")) {
48 $template->param(pedigree => [pedigree($page)]);