diff options
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r-- | IkiWiki.pm | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm index d9559bde4..a732be999 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -553,7 +553,7 @@ sub pagespec_translate ($) { #{{{ elsif ($word eq "(" || $word eq ")" || $word eq "!") { $code.=" ".$word; } - elsif ($word =~ /^(link|backlink|creation_month|creation_year|creation_day)\((.+)\)$/) { + elsif ($word =~ /^(link|backlink|created_before|created_after|creation_month|creation_year|creation_day)\((.+)\)$/) { $code.=" match_$1(\$page, ".safequote($2).")"; } else { @@ -598,6 +598,30 @@ sub match_backlink ($$) { #{{{ match_link(pop, pop); } #}}} +sub match_created_before ($$) { #{{{ + my $page=shift; + my $testpage=shift; + + if (exists $pagectime{$testpage}) { + return $pagectime{$page} < $pagectime{$testpage}; + } + else { + return 0; + } +} #}}} + +sub match_created_after ($$) { #{{{ + my $page=shift; + my $testpage=shift; + + if (exists $pagectime{$testpage}) { + return $pagectime{$page} > $pagectime{$testpage}; + } + else { + return 0; + } +} #}}} + sub match_creation_day ($$) { #{{{ return ((gmtime($pagectime{shift()}))[3] == shift); } #}}} |