2 package IkiWiki::Plugin::testpagespec;
9 hook(type => "preprocess", id => "testpagespec", call => \&preprocess);
12 sub preprocess (@) { #{{{
15 foreach my $param (qw{match pagespec}) {
16 if (! exists $params{$param}) {
17 return "[[testpagespec missing $param parameter]]";
21 add_depends($params{page}, $params{pagespec});
23 my $ret=pagespec_match($params{match}, $params{pagespec},
24 location => $params{page});
28 elsif (! defined $ret) {
29 return "match failed: $@";
32 return "no match: $ret";