]> sipb.mit.edu Git - ikiwiki.git/commitdiff
allow spans
authorJoey Hess <joey@gnu.kitenet.net>
Mon, 12 Oct 2009 03:44:50 +0000 (23:44 -0400)
committerJoey Hess <joey@gnu.kitenet.net>
Mon, 12 Oct 2009 03:44:50 +0000 (23:44 -0400)
doc/ikiwiki-calendar.mdwn
ikiwiki-calendar

index e2cc612f31c806e02d32a2a9cb4a87bdc571e6da..3f5c6a29e529ffff0519ceeb84549c340dcb2212 100644 (file)
@@ -4,7 +4,7 @@ ikiwiki-calendar - create calendar archive pages
 
 # SYNOPSIS
 
 
 # SYNOPSIS
 
-ikiwiki-calendar [-f] your.setup [pagespec] [year]
+ikiwiki-calendar [-f] your.setup [pagespec] [startyear [endyear]]
 
 # DESCRIPTION
 
 
 # DESCRIPTION
 
@@ -22,8 +22,8 @@ default is all pages. To limit it to only posts in a blog,
 use something like "posts/* and !*/Discussion".
 
 It defaults to creating calendar pages for the current
 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.
 
 Existing pages will not be overwritten by this command by default.
 Use the `-f` switch to force it to overwrite any existing pages.
index 074f0d6fd601d0f0d3933f89b9a41c25eddad7f8..a9548d6ec63813d2c150938f1df82ae5da2d6b4a 100755 (executable)
@@ -15,7 +15,8 @@ GetOptions(
 ) || usage();
 my $setup=shift                || usage();
 my $pagespec=shift     || "*";
 ) || 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);
 
 %config=IkiWiki::defaultconfig();
 IkiWiki::Setup::load($setup);
@@ -43,7 +44,7 @@ sub writearchive ($$;$) {
        }
 }
 
        }
 }
 
-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);
        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);