From 494e7ab8baedb5e4f8c7d1ff0d88ecd8b7d4a775 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 21 Jul 2008 13:53:34 -0400 Subject: redirect after removal --- IkiWiki/Plugin/remove.pm | 8 ++++++++ 1 file changed, 8 insertions(+) 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); -- cgit v1.2.3