Photos
Blog
Projects
vanrenterghem.biz
projects
/
git.ikiwiki.info.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove link spam
[git.ikiwiki.info.git]
/
IkiWiki
/
Plugin
/
sidebar.pm
diff --git
a/IkiWiki/Plugin/sidebar.pm
b/IkiWiki/Plugin/sidebar.pm
index f706480caabaf3f39855e03ec26f6ee627fcd226..c1146b7b4394c7203f452ef36606c5a51242ea14 100644
(file)
--- a/
IkiWiki/Plugin/sidebar.pm
+++ b/
IkiWiki/Plugin/sidebar.pm
@@
-22,7
+22,7
@@
sub getsetup () {
},
global_sidebars => {
type => "boolean",
},
global_sidebars => {
type => "boolean",
- example
s
=> 1,
+ example => 1,
description => "show sidebar page on all pages?",
safe => 1,
rebuild => 1,
description => "show sidebar page on all pages?",
safe => 1,
rebuild => 1,
@@
-33,13
+33,11
@@
my %pagesidebar;
sub preprocess (@) {
my %params=@_;
sub preprocess (@) {
my %params=@_;
- my $content=shift;
- shift;
my $page=$params{page};
return "" unless $page eq $params{destpage};
my $page=$params{page};
return "" unless $page eq $params{destpage};
- if (! defined $
content
) {
+ if (! defined $
params{content}
) {
$pagesidebar{$page}=undef;
}
else {
$pagesidebar{$page}=undef;
}
else {
@@
-49,8
+47,7
@@
sub preprocess (@) {
$pagesidebar{$page}=
IkiWiki::htmlize($page, $page, $type,
IkiWiki::linkify($page, $page,
$pagesidebar{$page}=
IkiWiki::htmlize($page, $page, $type,
IkiWiki::linkify($page, $page,
- IkiWiki::preprocess($page, $page,
- IkiWiki::filter($page, $page, $content))));
+ IkiWiki::preprocess($page, $page, $params{content})));
}
return "";
}
return "";
@@
-62,7
+59,7
@@
my $oldcontent;
sub sidebar_content ($) {
my $page=shift;
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};
return if ! exists $pagesidebar{$page} &&
defined $config{global_sidebars} && ! $config{global_sidebars};
@@
-99,11
+96,10
@@
sub sidebar_content ($) {
sub pagetemplate (@) {
my %params=@_;
sub pagetemplate (@) {
my %params=@_;
- my $page=$params{page};
my $template=$params{template};
my $template=$params{template};
-
-
if (
$template->query(name => "sidebar")) {
- my $content=sidebar_content($pa
ge
);
+ if ($params{destpage} eq $params{page} &&
+
$template->query(name => "sidebar")) {
+ my $content=sidebar_content($pa
rams{destpage}
);
if (defined $content && length $content) {
$template->param(sidebar => $content);
}
if (defined $content && length $content) {
$template->param(sidebar => $content);
}