use warnings;
use strict;
-use IkiWiki 2.00;
+use IkiWiki 3.00;
-sub import { #{{{
+sub import {
+ hook(type => "getsetup", id => "testpagespec", call => \&getsetup);
hook(type => "preprocess", id => "testpagespec", call => \&preprocess);
-} # }}}
+}
-sub preprocess (@) { #{{{
+sub getsetup () {
+ return
+ plugin => {
+ safe => 1,
+ rebuild => undef,
+ },
+}
+
+sub preprocess (@) {
my %params=@_;
foreach my $param (qw{match pagespec}) {
if (! exists $params{$param}) {
- return "[[testpagespec $param parameter is required]]";
+ error sprintf(gettext("%s parameter is required"), $param);
}
}
else {
return "no match: $ret";
}
-} # }}}
+}
1