From: Joey Hess Date: Sun, 15 Jun 2008 20:11:11 +0000 (-0400) Subject: map: Add a "show" parameter. "show=title" can be used to display page titles, rather... X-Git-Tag: 2.51~85 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=71d984b3109e7d5ab9e7e41bb50dc00a1787dd6f;p=ikiwiki.git map: Add a "show" parameter. "show=title" can be used to display page titles, rather than the default page name. Based on a patch from Jaldhar H. Vyas, Closes: #484510 --- diff --git a/IkiWiki/Plugin/map.pm b/IkiWiki/Plugin/map.pm index 581ae5011..af08005b8 100644 --- a/IkiWiki/Plugin/map.pm +++ b/IkiWiki/Plugin/map.pm @@ -25,8 +25,13 @@ sub preprocess (@) { #{{{ my %mapitems; foreach my $page (keys %pagesources) { if (pagespec_match($page, $params{pages}, location => $params{page})) { - $mapitems{$page}=1; - + if (exists $params{show} && + exists $pagestate{$page}{meta}{$params{show}}) { + $mapitems{$page}=$pagestate{$page}{meta}{$params{show}}; + } + else { + $mapitems{$page}=$page; + } # Check for a common prefix. if (! defined $common_prefix) { $common_prefix=$page; @@ -66,7 +71,7 @@ sub preprocess (@) { #{{{ my $openli=0; my $dummy=0; my $map = "
\n