summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-09-14 19:09:16 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-09-14 19:09:16 +0000
commit1e7b0415d3d78036d1e5e1f37bca198a67182e12 (patch)
tree1178ff6eb84457f2f4b56fa18a936f512fe6bb31 /IkiWiki/Plugin
parent906dcfd518c9597dd68ddf30c28bb68e9cbf8555 (diff)
if an inlined page has the same copyright or license as the page it's
inlined into, don't display them twice
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/meta.pm17
1 files changed, 12 insertions, 5 deletions
diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
index a4dd541f9..273be135a 100644
--- a/IkiWiki/Plugin/meta.pm
+++ b/IkiWiki/Plugin/meta.pm
@@ -128,6 +128,7 @@ sub preprocess (@) { #{{{
sub pagetemplate (@) { #{{{
my %params=@_;
my $page=$params{page};
+ my $destpage=$params{destpage};
my $template=$params{template};
$template->param(meta => $meta{$page})
@@ -142,11 +143,17 @@ sub pagetemplate (@) { #{{{
if exists $author{$page} && $template->query(name => "author");
$template->param(authorurl => $authorurl{$page})
if exists $authorurl{$page} && $template->query(name => "authorurl");
- $template->param(license => $license{$page})
- if exists $license{$page} && $template->query(name => "license");
- $template->param(copyright => $copyright{$page})
- if exists $copyright{$page} && $template->query(name => "copyright");
-
+
+ if (exists $license{$page} && $template->query(name => "license") &&
+ ($page ne $destpage || ! exists $license{$destpage} ||
+ $license{$page} ne $license{$destpage})) {
+ $template->param(license => $license{$page})
+ }
+ if (exists $copyright{$page} && $template->query(name => "copyright") &&
+ ($page ne $destpage || ! exists $copyright{$destpage} ||
+ $copyright{$page} ne $copyright{$destpage})) {
+ $template->param(copyright => $copyright{$page})
+ }
} # }}}
1