Photos
Blog
Projects
vanrenterghem.biz
projects
/
git.ikiwiki.info.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated my links
[git.ikiwiki.info.git]
/
IkiWiki
/
Plugin
/
testpagespec.pm
diff --git
a/IkiWiki/Plugin/testpagespec.pm
b/IkiWiki/Plugin/testpagespec.pm
index 4966f4e10b1a01d441cb45a4fb75205edaf4fe74..440fca33be02cc6cf91ff9072c725d936571b334 100644
(file)
--- a/
IkiWiki/Plugin/testpagespec.pm
+++ b/
IkiWiki/Plugin/testpagespec.pm
@@
-3,15
+3,30
@@
package IkiWiki::Plugin::testpagespec;
use warnings;
use strict;
use warnings;
use strict;
-use IkiWiki
2
.00;
+use IkiWiki
3
.00;
-sub import { #{{{
+sub import {
+ hook(type => "getsetup", id => "testpagespec", call => \&getsetup);
hook(type => "preprocess", id => "testpagespec", call => \&preprocess);
hook(type => "preprocess", id => "testpagespec", call => \&preprocess);
-}
# }}}
+}
-sub preprocess (@) { #{{{
+sub getsetup () {
+ return
+ plugin => {
+ safe => 1,
+ rebuild => undef,
+ },
+}
+
+sub preprocess (@) {
my %params=@_;
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},
add_depends($params{page}, $params{pagespec});
my $ret=pagespec_match($params{match}, $params{pagespec},
@@
-22,6
+37,6
@@
sub preprocess (@) { #{{{
else {
return "no match: $ret";
}
else {
return "no match: $ret";
}
-}
# }}}
+}
1
1