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};
24 my @pagepath=(split("/", $page));
25 my $pagedepth=@pagepath;
26 foreach my $dir (@pagepath) {
27 next if $dir eq 'index';
29 $height=($pagedepth - $depth);
31 url => urlto($path, $page),
36 "height_$height" => 1,
39 $title=IkiWiki::pagetitle($dir);
45 sub pagetemplate (@) { #{{{
47 my $page=$params{page};
48 my $template=$params{template};
50 if ($template->query(name => "pedigree")) {
51 $template->param(pedigree => [pedigree($page)]);