diff options
author | Louis <spalax@gresille.org> | 2014-07-07 09:40:53 +0200 |
---|---|---|
committer | Louis <spalax@gresille.org> | 2014-07-07 09:40:53 +0200 |
commit | 492a22ac75f8b41a427a98c44525b01a6fd181b5 (patch) | |
tree | 893b5f289407dd268462dd15e403c3de7c451c74 /IkiWiki/Plugin | |
parent | 59b46942e01b32138d056381249effbbaf773892 (diff) | |
download | ikiwiki-492a22ac75f8b41a427a98c44525b01a6fd181b5.tar ikiwiki-492a22ac75f8b41a427a98c44525b01a6fd181b5.tar.gz |
Making use of the transient plugin
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/calendar.pm | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm index 6fcd8c2ca..185026d20 100644 --- a/IkiWiki/Plugin/calendar.pm +++ b/IkiWiki/Plugin/calendar.pm @@ -32,6 +32,8 @@ sub import { 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 () { @@ -63,14 +65,6 @@ 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, @@ -83,10 +77,7 @@ sub getsetup () { 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} = '*'; @@ -128,18 +119,9 @@ sub autocreate { $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($;$) { |