# A plugin for ikiwiki to implement adding a footer with copyright information # based on a default value taken out of a file. # Copyright © 2007 Thomas Schwinge # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2, or (at your option) any later # version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # A footer with copyright information will be added to every rendered page if # (a) such a footer isn't present already (see the `meta' plugin's # ``copyright'' facility) and (b) a file `copyright.html' is found (using the # same rules as for the sidebar plugin). # # The state which page's copyright text was gathered from which source is not # tracked, so you'll need a full wiki-rebuild if (b)'s files are changed. # # You can use wiki links in `copyright.html'. package IkiWiki::Plugin::copyright; use warnings; use strict; use IkiWiki 2.00; sub import { hook (type => "pagetemplate", id => "copyright", call => \&pagetemplate, # Run last, as to have the `meta' plugin do its work first. last => 1); } sub pagetemplate (@) { my %params = @_; my $page = $params{page}; my $destpage = $params{destpage}; my $template = $params{template}; if ($template->query (name => "copyright") && ! defined $template->param ('copyright')) { my $content; my $copyright_page = bestlink ($page, "copyright") || return; my $copyright_file = $pagesources{$copyright_page} || return; #my $pagetype = pagetype ($copyright_file); # Check if ``$pagetype eq 'html'''? $content = readfile (srcfile ($copyright_file)); if (defined $content && length $content) { $template->param (copyright => IkiWiki::linkify ($page, $destpage, $content)); } } } 1 ='2'/>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/8c/03
parentba46132213560cf3335d53560d519c0ec0190da2 (diff)
master
Diffstat (limited to 'tags/8c/03')
-rw-r--r--tags/8c/03/000b01ceb61f%244b4f6960%24e1ee3c20%24@dk/attachment0
-rw-r--r--tags/8c/03/0E97B528-6FA9-4B3D-8894-C6C7E39F7E39@kaospilot.dk/hb0
-rw-r--r--tags/8c/03/1549382678.241747.1651376752.484948D5@webmail.messagingengine.com/debian0
-rw-r--r--tags/8c/03/1549382678.241747.1651376752.484948D5@webmail.messagingengine.com/unread0
-rw-r--r--tags/8c/03/20180721100315.223B51CCD59@lxp5.free-owl.de/sys0
-rw-r--r--tags/8c/03/20180721100315.223B51CCD59@lxp5.free-owl.de/unread0
-rw-r--r--tags/8c/03/20181001190001.E5FC21CD5A4@lxp5.free-owl.de/sys0
-rw-r--r--tags/8c/03/20181001190001.E5FC21CD5A4@lxp5.free-owl.de/unread0
-rw-r--r--tags/8c/03/20181031055323.7EB12525@jawa.homebase.dk/hb0
-rw-r--r--tags/8c/03/20181031055323.7EB12525@jawa.homebase.dk/sys0
-rw-r--r--tags/8c/03/20181031055323.7EB12525@jawa.homebase.dk/unread0
-rw-r--r--tags/8c/03/20181130050216.7D7401CCD84@lxp5.free-owl.de/sys0
-rw-r--r--tags/8c/03/20181130050216.7D7401CCD84@lxp5.free-owl.de/unread0
-rw-r--r--tags/8c/03/20190503070003.9ACC71C8F60@lxp5.free-owl.de/sys0
-rw-r--r--tags/8c/03/20190503070003.9ACC71C8F60@lxp5.free-owl.de/unread0
-rw-r--r--tags/8c/03/87a7dlgey2.fsf@skimble.plus.com/debian0
-rw-r--r--tags/8c/03/87a7dlgey2.fsf@skimble.plus.com/signed0
-rw-r--r--tags/8c/03/87pq98dkhb.fsf@debian.home/debian0
-rw-r--r--tags/8c/03/87pq98dkhb.fsf@debian.home/signed0
-rw-r--r--tags/8c/03/B5599432.25D6%25ronald@jones.dk/inbox0
-rw-r--r--tags/8c/03/B5599432.25D6%25ronald@jones.dk/old0
-rw-r--r--tags/8c/03/EF333D25-8052-43FE-A635-7252391822D1@freudenbergs.de/sugar0
-rw-r--r--tags/8c/03/EF333D25-8052-43FE-A635-7252391822D1@freudenbergs.de/unread0
-rw-r--r--tags/8c/03/d505626a-9e35-9e84-cb33-abfc45da30c1@codewiz.org/inbox0
-rw-r--r--tags/8c/03/d505626a-9e35-9e84-cb33-abfc45da30c1@codewiz.org/old0
-rw-r--r--tags/8c/03/d505626a-9e35-9e84-cb33-abfc45da30c1@codewiz.org/sugar0
-rw-r--r--tags/8c/03/e6c90dcb-5701-7772-e2b4-f927a586921c@jones.dk/replied0
-rw-r--r--tags/8c/03/e6c90dcb-5701-7772-e2b4-f927a586921c@jones.dk/unread0
-rw-r--r--tags/8c/03/handler.s.B.160172370619222.transcript@bugs.debian.org/debian0
-rw-r--r--tags/8c/03/handler.s.B.160172370619222.transcript@bugs.debian.org/unread0
30 files changed, 0 insertions, 0 deletions