X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/f8a7fb227b59463b37180b1e525c5d19ec0e43cb..2bd8ada5a619a1c32bf19f44e4f96e083ceb17b8:/IkiWiki/Plugin/testpagespec.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/testpagespec.pm b/IkiWiki/Plugin/testpagespec.pm index 56dc03cef..f9ec90d87 100644 --- a/IkiWiki/Plugin/testpagespec.pm +++ b/IkiWiki/Plugin/testpagespec.pm @@ -12,12 +12,22 @@ sub import { #{{{ sub preprocess (@) { #{{{ my %params=@_; + foreach my $param (qw{match pagespec}) { + if (! exists $params{$param}) { + return "[[testpagespec $param parameter is required]]"; + } + } + add_depends($params{page}, $params{pagespec}); my $ret=pagespec_match($params{match}, $params{pagespec}, location => $params{page}); - return $ret if ! $ret; - return "the pagespec matches"; + if ($ret) { + return "match: $ret"; + } + else { + return "no match: $ret"; + } } # }}} 1