X-Git-Url: http://git.tremily.us/?a=blobdiff_plain;f=IkiWiki%2FPlugin%2Ftestpagespec.pm;h=440fca33be02cc6cf91ff9072c725d936571b334;hb=937b24e0cf98d75dd353d80267efddcecab9e908;hp=77fab497ee0e5abd8d88286d59fe9f4e0574db86;hpb=5c6b96967d70f41040e90671cff03e4a11239e63;p=ikiwiki.git diff --git a/IkiWiki/Plugin/testpagespec.pm b/IkiWiki/Plugin/testpagespec.pm index 77fab497e..440fca33b 100644 --- a/IkiWiki/Plugin/testpagespec.pm +++ b/IkiWiki/Plugin/testpagespec.pm @@ -3,18 +3,27 @@ package IkiWiki::Plugin::testpagespec; 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 missing $param parameter]]"; + error sprintf(gettext("%s parameter is required"), $param); } } @@ -28,6 +37,6 @@ sub preprocess (@) { #{{{ else { return "no match: $ret"; } -} # }}} +} 1