aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-07-25 01:04:56 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-07-25 01:04:56 +0000
commit4de235a385bf569e95d3902c7a1f688b5fbf0d44 (patch)
tree2eb0fc6c6442b2783d0418d92aef2c0d12855447 /IkiWiki
parent711f86e627e56f317d367d1d9a5bd71afb7697df (diff)
downloadikiwiki-4de235a385bf569e95d3902c7a1f688b5fbf0d44.tar
ikiwiki-4de235a385bf569e95d3902c7a1f688b5fbf0d44.tar.gz
* Make the map plugin notice when pages in the map are deleted and update
it.
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/map.pm13
1 files changed, 8 insertions, 5 deletions
diff --git a/IkiWiki/Plugin/map.pm b/IkiWiki/Plugin/map.pm
index 5aa2852de..1194f6ed2 100644
--- a/IkiWiki/Plugin/map.pm
+++ b/IkiWiki/Plugin/map.pm
@@ -19,18 +19,21 @@ sub preprocess (@) { #{{{
my %params=@_;
$params{pages}="*" unless defined $params{pages};
- # Needs to update whenever a page is added or removed, so
- # register a dependency.
- add_depends($params{page}, $params{pages});
-
# Get all the items to map.
my @mapitems = ();
- foreach my $page (keys %links) {
+ foreach my $page (keys %pagesources) {
if (pagespec_match($page, $params{pages}, location => $params{page})) {
push @mapitems, $page;
}
}
+ # Needs to update whenever a page is added or removed, so
+ # register a dependency.
+ add_depends($params{page}, $params{pages});
+ # Explicitly add all currently shown pages, to detect when pages
+ # are removed.
+ add_depends($params{page}, join(" or ", @mapitems));
+
# Create the map.
my $indent=0;
my $openli=0;