]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/testpagespec.pm
use perl modules up front
[ikiwiki.git] / IkiWiki / Plugin / testpagespec.pm
index 77fab497ee0e5abd8d88286d59fe9f4e0574db86..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 missing $param parameter]]";
+                       error sprintf(gettext("%s parameter is required"), $param);
                }
        }