2 package IkiWiki::Plugin::pagetemplate;
11 hook(type => "getsetup", id => "pagetemplate", call => \&getsetup);
12 hook(type => "preprocess", id => "pagetemplate", call => \&preprocess);
13 hook(type => "templatefile", id => "pagetemplate", call => \&templatefile);
27 if (! exists $params{template} ||
28 $params{template} !~ /^[-A-Za-z0-9._+]+$/ ||
29 ! defined IkiWiki::template_file($params{template})) {
30 error gettext("bad or missing template")
33 if ($params{page} eq $params{destpage}) {
34 $templates{$params{page}}=$params{template};
40 sub templatefile (@) {
43 if (exists $templates{$params{page}}) {
44 return $templates{$params{page}};