]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/testpagespec.pm
Merge commit 'upstream/master' into prv/po
[git.ikiwiki.info.git] / IkiWiki / Plugin / testpagespec.pm
index f9ec90d8791f8b5e6aa422ceb527fe272bfea9df..9f9b50f017bb5cb75a5ed1155984531d082d200d 100644 (file)
@@ -6,15 +6,24 @@ use strict;
 use IkiWiki 2.00;
 
 sub import { #{{{
+       hook(type => "getsetup", id => "testpagespec", call => \&getsetup);
        hook(type => "preprocess", id => "testpagespec", call => \&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);
                }
        }