]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/sidebar.pm
img test: Exercise a format that is uncommon on the web (BMP)
[git.ikiwiki.info.git] / IkiWiki / Plugin / sidebar.pm
index 808f0bed29d8dea4349874109b53e109501f6511..c1146b7b4394c7203f452ef36606c5a51242ea14 100644 (file)
@@ -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);
                }