summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-07-21 13:53:34 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-07-21 13:53:34 -0400
commit494e7ab8baedb5e4f8c7d1ff0d88ecd8b7d4a775 (patch)
tree2789cf2e5b2fd2c1a9b7b0b197c165353ff31bad /IkiWiki/Plugin
parentc924c76bd89d6d607b59c1d68ba32fae0fefc77a (diff)
redirect after removal
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/remove.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/remove.pm b/IkiWiki/Plugin/remove.pm
index 57c43cfdf..5bc59225c 100644
--- a/IkiWiki/Plugin/remove.pm
+++ b/IkiWiki/Plugin/remove.pm
@@ -123,6 +123,14 @@ sub sessioncgi ($$) { #{{{
IkiWiki::prune("$config{srcdir}/$file");
IkiWiki::refresh();
IkiWiki::saveindex();
+
+ # Redirect to parent of the page.
+ my $parent=IkiWiki::dirname($page);
+ if (! exists $pagesources{$parent}) {
+ $parent="index";
+ }
+ IkiWiki::redirect($q, $config{url}."/".htmlpage($parent));
+ exit 0;
}
else {
IkiWiki::showform($form, $buttons, $session, $q);