2 # -*- cperl-indent-level: 8; -*-
3 # Ikiwiki parentlinks plugin.
4 package IkiWiki::Plugin::parentlinks;
11 hook(type => "pagetemplate", id => "parentlinks", call => \&pagetemplate);
14 sub parentlinks ($) { #{{{
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 => "parentlinks")) {
51 $template->param(parentlinks => [parentlinks($page)]);