]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/calendar.pm
typo
[git.ikiwiki.info.git] / IkiWiki / Plugin / calendar.pm
index 4bb4c2c2192ef857b61da9e63608dce2b58b5020..b808c9d1d64bbc5adf226335e14b31d7b5c67085 100644 (file)
@@ -30,10 +30,22 @@ my $time=time;
 my @now=localtime($time);
 
 sub import { #{{{
+       hook(type => "getsetup", id => "version", call => \&getsetup);
        hook(type => "needsbuild", id => "version", call => \&needsbuild);
        hook(type => "preprocess", id => "calendar", call => \&preprocess);
 } #}}}
 
+sub getsetup () { #{{{
+       return
+               archivebase => {
+                       type => "string",
+                       default => "archives",
+                       description => "base of the archives hierarchy",
+                       safe => 1,
+                       rebuild => 1,
+               },
+} #}}}
+
 sub is_leap_year (@) { #{{{
        my %params=@_;
        return ($params{year} % 4 == 0 && (($params{year} % 100 != 0) || $params{year} % 400 == 0));
@@ -390,7 +402,8 @@ sub needsbuild (@) { #{{{
                                # the current day
                                push @$needsbuild, $pagesources{$page};
                        }
-                       if (grep { $_ eq $pagesources{$page} } @$needsbuild) {
+                       if (exists $pagesources{$page} && 
+                           grep { $_ eq $pagesources{$page} } @$needsbuild) {
                                # remove state, will be re-added if
                                # the calendar is still there during the
                                # rebuild