]> sipb.mit.edu Git - ikiwiki.git/blob - IkiWiki/Plugin/testpagespec.pm
* Make pagespec_match on failure return a value that is false, but in a
[ikiwiki.git] / IkiWiki / Plugin / testpagespec.pm
1 #!/usr/bin/perl
2 package IkiWiki::Plugin::testpagespec;
3
4 use warnings;
5 use strict;
6 use IkiWiki 2.00;
7
8 sub import { #{{{
9         hook(type => "preprocess", id => "testpagespec", call => \&preprocess);
10 } # }}}
11
12 sub preprocess (@) { #{{{
13         my %params=@_;
14         
15         add_depends($params{page}, $params{pagespec});
16         
17         my $ret=pagespec_match($params{match}, $params{pagespec}, 
18                         location => $params{page});
19         return $ret if ! $ret;
20         return "the pagespec matches";
21 } # }}}
22
23 1