safe => 1,
rebuild => 1,
},
+ archive_pagespec => {
+ type => "pagespec",
+ example => "posts/* and !*/Discussion",
+ description => "PageSpec of pages to include in the archives; used by ikiwiki-calendar command",
+ link => 'ikiwiki/PageSpec',
+ safe => 1,
+ rebuild => 0,
+ },
}
sub is_leap_year (@) {
for master language.
* po: Configuring the same language as master and slave confuses processing;
so filter out such a misconfiguration.
+ * calendar: Add archive_pagespec, which is used by ikiwiki-calendar to
+ specify which pages to include on the calendar archive pages.
+ (The pagespec can still also be specified on the ikiwiki-calendar command
+ line.)
-- Joey Hess <joeyh@debian.org> Sun, 04 Apr 2010 12:17:11 -0400
be created inside its `srcdir`, beneath the `archivebase`
directory used by the calendar plugin (default "archives").
-You will probably want to specify a [[ikiwiki/PageSpec]]
-to control which pages are included on the calendars. The
-default is all pages. To limit it to only posts in a blog,
+To control which pages are included on the calendars,
+a [[ikiwiki/PageSpec]] can be specified. The default is
+all pages, or the pages specified by the `comments_pagespec`
+setting in the config file. A pagespec can also be specified
+on the command line. To limit it to only posts in a blog,
use something like "posts/* and !*/Discussion".
It defaults to creating calendar pages for the current
"month" or "year". The default is a month view calendar.
* `pages` - Specifies the [[ikiwiki/PageSpec]] of pages to link to from the
month calendar. Defaults to "*".
-* `archivebase` - Configures the base of the archives hierarchy. The
- default is "archives". Note that this default can also be overridden
+* `archivebase` - Configures the base of the archives hierarchy.
+ The default is "archives". Note that this default can also be overridden
for the whole wiki by setting `archivebase` in ikiwiki's setup file.
+ Calendars link to pages under here, with names like "2010/04" and
+ "2010". These pages can be automatically created using the
+ [[ikiwiki-calendar]] tool.
* `year` - The year for which the calendar is requested. Defaults to the
current year.
* `month` - The numeric month for which the calendar is requested, in the
"force" => \$force,
) || usage();
my $setup=shift || usage();
-my $pagespec=shift || "*";
+my $pagespec=shift;
my $startyear=shift || 1900+(localtime(time))[5];
my $endyear=shift || $startyear;
my $archivebase = 'archives';
$archivebase = $config{archivebase} if defined $config{archivebase};
+if (! defined $pagespec) {
+ $pagespec=$config{archive_pagespec} || "*";
+}
+
sub writearchive ($$;$) {
my $template=template(shift);
my $year=shift;