X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/e78c25d1b2a4c428069abb7b5a4df5cb8fc1d060..554f4c2b5fdf5251505a7fd9abb0d53839f1fab5:/IkiWiki/Plugin/calendar.pm diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm index 0bb0e81fd..4bb4c2c21 100644 --- a/IkiWiki/Plugin/calendar.pm +++ b/IkiWiki/Plugin/calendar.pm @@ -34,25 +34,6 @@ sub import { #{{{ hook(type => "preprocess", id => "calendar", call => \&preprocess); } #}}} -sub needsbuild (@) { #{{{ - my $needsbuild=shift; - foreach my $page (keys %pagestate) { - if (exists $pagestate{$page}{calendar}{nextchange}) { - if ($pagestate{$page}{calendar}{nextchange} <= $time) { - # force a rebuild so the calendar shows - # the current day - push @$needsbuild, $pagesources{$page}; - } - if (grep { $_ eq $pagesources{$page} } @$needsbuild) { - # remove state, will be re-added if - # the calendar is still there during the - # rebuild - delete $pagestate{$page}{calendar}; - } - } - } -} # }}} - sub is_leap_year (@) { #{{{ my %params=@_; return ($params{year} % 4 == 0 && (($params{year} % 100 != 0) || $params{year} % 400 == 0)); @@ -400,4 +381,23 @@ sub preprocess (@) { #{{{ return "\n
$calendar
\n"; } #}} +sub needsbuild (@) { #{{{ + my $needsbuild=shift; + foreach my $page (keys %pagestate) { + if (exists $pagestate{$page}{calendar}{nextchange}) { + if ($pagestate{$page}{calendar}{nextchange} <= $time) { + # force a rebuild so the calendar shows + # the current day + push @$needsbuild, $pagesources{$page}; + } + if (grep { $_ eq $pagesources{$page} } @$needsbuild) { + # remove state, will be re-added if + # the calendar is still there during the + # rebuild + delete $pagestate{$page}{calendar}; + } + } + } +} # }}} + 1