diff options
author | Joey Hess <joey@kitenet.net> | 2007-12-09 00:05:07 -0500 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2007-12-09 00:05:07 -0500 |
commit | c8cb931890cb9ff614683eef27fc0bfeb308d8bd (patch) | |
tree | f62708653ad3305263b519139f457bbb87335c87 /IkiWiki/Plugin | |
parent | aa57c5ab5e024f783b7935f36b00c3c1a8e9e5f1 (diff) |
reorg
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/calendar.pm | 38 |
1 files changed, 19 insertions, 19 deletions
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<div><div class=\"calendar\">$calendar</div></div>\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 |