X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/bbb3a8aac760cf21ffb21a0bc779adc23de69943..e8a23c299e0ec548110283516b8413cdaff8737e:/IkiWiki/Plugin/sidebar.pm diff --git a/IkiWiki/Plugin/sidebar.pm b/IkiWiki/Plugin/sidebar.pm index f706480ca..0350f2b71 100644 --- a/IkiWiki/Plugin/sidebar.pm +++ b/IkiWiki/Plugin/sidebar.pm @@ -33,13 +33,11 @@ my %pagesidebar; sub preprocess (@) { my %params=@_; - my $content=shift; - shift; my $page=$params{page}; return "" unless $page eq $params{destpage}; - if (! defined $content) { + if (! defined $params{content}) { $pagesidebar{$page}=undef; } else { @@ -50,7 +48,7 @@ sub preprocess (@) { IkiWiki::htmlize($page, $page, $type, IkiWiki::linkify($page, $page, IkiWiki::preprocess($page, $page, - IkiWiki::filter($page, $page, $content)))); + IkiWiki::filter($page, $page, $params{content})))); } return ""; @@ -62,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}; @@ -99,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); }