From 71d984b3109e7d5ab9e7e41bb50dc00a1787dd6f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 15 Jun 2008 16:11:11 -0400 Subject: [PATCH] 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 --- IkiWiki/Plugin/map.pm | 12 +++++++++--- debian/changelog | 3 +++ doc/plugins/map.mdwn | 5 +++++ doc/plugins/map/discussion.mdwn | 2 +- doc/users/The_TOVA_Company.mdwn | 3 ++- 5 files changed, 20 insertions(+), 5 deletions(-) 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