fix sidebar directive parameter handling

master
Joey Hess 2010-04-15 17:50:43 -04:00
parent 4bbbd77a48
commit 4c6f5a48bc
2 changed files with 3 additions and 5 deletions

View File

@ -33,13 +33,11 @@ my %pagesidebar;
sub preprocess (@) { sub preprocess (@) {
my %params=@_; my %params=@_;
my $content=shift;
shift;
my $page=$params{page}; my $page=$params{page};
return "" unless $page eq $params{destpage}; return "" unless $page eq $params{destpage};
if (! defined $content) { if (! defined $params{content}) {
$pagesidebar{$page}=undef; $pagesidebar{$page}=undef;
} }
else { else {
@ -50,7 +48,7 @@ sub preprocess (@) {
IkiWiki::htmlize($page, $page, $type, IkiWiki::htmlize($page, $page, $type,
IkiWiki::linkify($page, $page, IkiWiki::linkify($page, $page,
IkiWiki::preprocess($page, $page, IkiWiki::preprocess($page, $page,
IkiWiki::filter($page, $page, $content)))); IkiWiki::filter($page, $page, $params{content}))));
} }
return ""; return "";

View File

@ -9,7 +9,7 @@ used to disable use of the sidebar page by default.
## examples ## examples
\[[!sidebar """ \[[!sidebar content="""
This is my custom sidebar for this page. This is my custom sidebar for this page.
\[[!calendar pages="posts/*"]] \[[!calendar pages="posts/*"]]