hook(type => "needsbuild", id => "calendar", call => \&needsbuild);
hook(type => "preprocess", id => "calendar", call => \&preprocess);
hook(type => "scan", id => "calendar", call => \&scan);
+
+ IkiWiki::loadplugin("transient");
}
sub getsetup () {
safe => 1,
rebuild => undef,
},
- calendar_autocreate_commit => {
- type => "boolean",
- example => 1,
- default => 1,
- description => "commit autocreated calendar pages",
- safe => 1,
- rebuild => 0,
- },
calendar_fill_gaps => {
type => "boolean",
example => 1,
sub checkconfig () {
if (! defined $config{calendar_autocreate}) {
- $config{calendar_autocreate} = defined $config{archivebase} || defined $config{calendar_autocreate_commit};
- }
- if (! defined $config{calendar_autocreate_commit}) {
- $config{calendar_autocreate_commit} = 1;
+ $config{calendar_autocreate} = defined $config{archivebase};
}
if (! defined $config{archive_pagespec}) {
$config{archive_pagespec} = '*';
$template->param(month => $month) if defined $month;
$template->param(pagespec => $config{archive_pagespec});
- my $dir = $config{srcdir};
- if (! $config{calendar_autocreate_commit}) {
- $dir = $IkiWiki::Plugin::transient::transientdir;
- }
+ my $dir = $IkiWiki::Plugin::transient::transientdir;
writefile($pagefile, $dir, $template->output);
- if ($config{rcs} && $config{calendar_autocreate_commit}) {
- IkiWiki::disable_commit_hook();
- IkiWiki::rcs_add($pagefile);
- IkiWiki::rcs_commit_staged(message => $message);
- IkiWiki::enable_commit_hook();
- }
}
sub calendarlink($;$) {
* `archive_pagespec` - [[ikiwiki/PageSpec]] of pages to include in the
archives, if option `calendar_autocreate` is on. It defaults to `*`.
* `calendar_autocreate` - Control whether new archive pages are created as
- needed. It defaults to being done only if (at least) one of options
- `archivebase` and `calendar_autocreate_commit` are set.
-* `calendar_autocreate_commit` - If set, causes new archive pages to be
- checked into version control. Defaults to 1.
+ needed. It defaults to being done only if option `archivebase` is set.
* `calendar_fill_gaps` - If set (and `calendar_autocreate` is set as well),
build calendar pages of emty years and months (but does not build pages older
than the older page, and younger than the younger page of the pagespec). If