my $map = "<div class='map'>\n<ul>\n";
foreach my $item (sort keys %mapitems) {
$item=~s/^\Q$common_prefix\E\///
my $map = "<div class='map'>\n<ul>\n";
foreach my $item (sort keys %mapitems) {
$item=~s/^\Q$common_prefix\E\///
my $baseitem=IkiWiki::dirname($item);
while (length $parent && length $baseitem && $baseitem !~ /^\Q$parent\E(\/|$)/) {
$parent=IkiWiki::dirname($parent);
my $baseitem=IkiWiki::dirname($item);
while (length $parent && length $baseitem && $baseitem !~ /^\Q$parent\E(\/|$)/) {
$parent=IkiWiki::dirname($parent);
$p.="/".shift(@bits);
$map .= "<li>"
.htmllink($params{page}, $params{destpage}, $p, class => "mapparent")
$p.="/".shift(@bits);
$map .= "<li>"
.htmllink($params{page}, $params{destpage}, $p, class => "mapparent")