From 1e7b0415d3d78036d1e5e1f37bca198a67182e12 Mon Sep 17 00:00:00 2001 From: joey Date: Fri, 14 Sep 2007 19:09:16 +0000 Subject: if an inlined page has the same copyright or license as the page it's inlined into, don't display them twice --- IkiWiki/Plugin/meta.pm | 17 ++++++++++++----- 1 file 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 -- cgit v1.2.3 @mail.gmail.com/sugar?h=master'>commitdiff
path: root/tags/8b/a7/b74fba2b0907061056y75c0123v45b105a0af8560f4@mail.gmail.com/sugar
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2023-06-27 09:35:08 +0200
committerJonas Smedegaard <dr@jones.dk>2023-06-27 09:35:08 +0200
commitfd54908da2b05c526dd3bee9b6dcd093214a220d (patch)
treec69c845069c99d1d01044f6fafda7c08433329c6 /tags/8b/a7/b74fba2b0907061056y75c0123v45b105a0af8560f4@mail.gmail.com/sugar
parentba46132213560cf3335d53560d519c0ec0190da2 (diff)
Diffstat (limited to 'tags/8b/a7/b74fba2b0907061056y75c0123v45b105a0af8560f4@mail.gmail.com/sugar')
-rw-r--r--tags/8b/a7/b74fba2b0907061056y75c0123v45b105a0af8560f4@mail.gmail.com/sugar0
1 files changed, 0 insertions, 0 deletions