X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/4c6f5a48bcfc2462a915387515bfa39b9239a7da..0cd67c515fad03797fa7792c10b507a0abb77c28:/IkiWiki/Plugin/sidebar.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/sidebar.pm b/IkiWiki/Plugin/sidebar.pm index 808f0bed2..c1146b7b4 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, @@ -47,8 +47,7 @@ sub preprocess (@) { $pagesidebar{$page}= IkiWiki::htmlize($page, $page, $type, IkiWiki::linkify($page, $page, - IkiWiki::preprocess($page, $page, - IkiWiki::filter($page, $page, $params{content})))); + IkiWiki::preprocess($page, $page, $params{content}))); } return ""; @@ -60,7 +59,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 +96,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); }