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.)

master
Joey Hess 2010-04-15 13:40:53 -04:00
parent 81ce1cf9da
commit 3131433f64
5 changed files with 27 additions and 6 deletions

View File

@ -47,6 +47,14 @@ sub getsetup () {
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 (@) {

4
debian/changelog vendored
View File

@ -27,6 +27,10 @@ ikiwiki (3.20100410) UNRELEASED; urgency=low
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

View File

@ -16,9 +16,11 @@ You must specify the setup file for your wiki. The pages will
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

View File

@ -40,9 +40,12 @@ An example crontab:
"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

View File

@ -15,7 +15,7 @@ GetOptions(
"force" => \$force,
) || usage();
my $setup=shift || usage();
my $pagespec=shift || "*";
my $pagespec=shift;
my $startyear=shift || 1900+(localtime(time))[5];
my $endyear=shift || $startyear;
@ -27,6 +27,10 @@ IkiWiki::checkconfig();
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;