X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/8fa8bd0adb034f05131648dcb7b14011672649e8..3de7d39ec6db4791f2b17c6242da9d380f67b701:/IkiWiki/Plugin/testpagespec.pm diff --git a/IkiWiki/Plugin/testpagespec.pm b/IkiWiki/Plugin/testpagespec.pm index 4966f4e10..9f9b50f01 100644 --- a/IkiWiki/Plugin/testpagespec.pm +++ b/IkiWiki/Plugin/testpagespec.pm @@ -6,12 +6,27 @@ 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}) { + error sprintf(gettext("%s parameter is required"), $param); + } + } + add_depends($params{page}, $params{pagespec}); my $ret=pagespec_match($params{match}, $params{pagespec},