X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/4c6f5a48bcfc2462a915387515bfa39b9239a7da..1f56dead00ee1188d9ed9650b9b2483b69c4d525:/IkiWiki/Plugin/sidebar.pm?ds=inline diff --git a/IkiWiki/Plugin/sidebar.pm b/IkiWiki/Plugin/sidebar.pm index 808f0bed2..0350f2b71 100644 --- a/IkiWiki/Plugin/sidebar.pm +++ b/IkiWiki/Plugin/sidebar.pm @@ -60,7 +60,7 @@ my $oldcontent; sub sidebar_content ($) { my $page=shift; - return $pagesidebar{$page} if defined $pagesidebar{$page}; + return delete $pagesidebar{$page} if defined $pagesidebar{$page}; return if ! exists $pagesidebar{$page} && defined $config{global_sidebars} && ! $config{global_sidebars}; @@ -97,11 +97,10 @@ sub sidebar_content ($) { sub pagetemplate (@) { my %params=@_; - my $page=$params{page}; my $template=$params{template}; - - if ($template->query(name => "sidebar")) { - my $content=sidebar_content($page); + if ($params{destpage} eq $params{page} && + $template->query(name => "sidebar")) { + my $content=sidebar_content($params{destpage}); if (defined $content && length $content) { $template->param(sidebar => $content); }