26 lines
393 B
Perl
26 lines
393 B
Perl
#!/usr/bin/perl
|
|
|
|
package IkiWiki::Plugin::selftemplate;
|
|
|
|
use warnings;
|
|
use strict;
|
|
use IkiWiki 3.00;
|
|
|
|
my %templates;
|
|
|
|
sub import {
|
|
hook(type => "templatefile", id => "selftemplate", call => \&templatefile);
|
|
}
|
|
|
|
sub templatefile (@) {
|
|
my %params=@_;
|
|
|
|
if (defined IkiWiki::template_file("$params{page}.tmpl")) {
|
|
return $templates{$params{page}}="$params{page}.tmpl";
|
|
}
|
|
|
|
return undef;
|
|
}
|
|
|
|
1
|