X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/4c6f5a48bcfc2462a915387515bfa39b9239a7da..07a08122d926ab6b7741c94bc6c0038ffe0113fb:/IkiWiki/Plugin/sidebar.pm?ds=inline diff --git a/IkiWiki/Plugin/sidebar.pm b/IkiWiki/Plugin/sidebar.pm index 808f0bed2..2d495db2c 100644 --- a/IkiWiki/Plugin/sidebar.pm +++ b/IkiWiki/Plugin/sidebar.pm @@ -22,7 +22,7 @@ sub getsetup () { }, global_sidebars => { type => "boolean", - examples => 1, + example => 1, description => "show sidebar page on all pages?", safe => 1, rebuild => 1, @@ -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); }