summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/parentlinks.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-09-27 17:40:41 -0400
committerJoey Hess <joey@gnu.kitenet.net>2009-09-27 18:29:16 -0400
commit2acaa15830760695eb673ddb0b17aed715e97f3c (patch)
tree05c65f32053c52d0a0eac9f2f31ee55628e3e76b /IkiWiki/Plugin/parentlinks.pm
parent3440a015ba7f4995f5a9c54c5ffff4aeec54ca54 (diff)
parentlinks: Add has_parentlinks template parameter to allow styling the toplevel index differently etc.
Diffstat (limited to 'IkiWiki/Plugin/parentlinks.pm')
-rw-r--r--IkiWiki/Plugin/parentlinks.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/parentlinks.pm b/IkiWiki/Plugin/parentlinks.pm
index 1ee69cbff..b01d76f80 100644
--- a/IkiWiki/Plugin/parentlinks.pm
+++ b/IkiWiki/Plugin/parentlinks.pm
@@ -55,8 +55,11 @@ sub pagetemplate (@) {
my $page=$params{page};
my $template=$params{template};
- if ($template->query(name => "parentlinks")) {
- $template->param(parentlinks => [parentlinks($page)]);
+ if ($template->query(name => "parentlinks") ||
+ $template->query(name => "has_parentlinks")) {
+ my @links=[parentlinks($page)];
+ $template->param(parentlinks => \@links);
+ $template->param(has_parentlinks => (@links > 0));
}
}