# SYNOPSIS
-ikiwiki-calendar [-f] your.setup [pagespec] [year]
+ikiwiki-calendar [-f] your.setup [pagespec] [startyear [endyear]]
# DESCRIPTION
use something like "posts/* and !*/Discussion".
It defaults to creating calendar pages for the current
-year, as well as the previous year, and the next year.
-If you specify a year, it will create pages for that year.
+year. If you specify a year, it will create pages for that year.
+Specify a second year to create pages for a span of years.
Existing pages will not be overwritten by this command by default.
Use the `-f` switch to force it to overwrite any existing pages.
) || usage();
my $setup=shift || usage();
my $pagespec=shift || "*";
-my $year=shift || 1900+(localtime(time))[5];
+my $startyear=shift || 1900+(localtime(time))[5];
+my $endyear=shift || $startyear;
%config=IkiWiki::defaultconfig();
IkiWiki::Setup::load($setup);
}
}
-foreach my $y ($year-1, $year, $year+1) {
+foreach my $y ($startyear..$endyear) {
writearchive("calendaryear.tmpl", $y);
foreach my $m (qw{01 02 03 04 05 06 07 08 09 10 11 12}) {
writearchive("calendarmonth.tmpl", $y, $m);