summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/recentchanges.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-01-29 13:08:48 -0500
committerJoey Hess <joey@kodama.kitenet.net>2008-01-29 13:08:48 -0500
commit35bc35660cafad2e8661077a9196bbf9b6fd3663 (patch)
tree2af3b3e5c763f93c232e0812b38c42f9727f98f0 /IkiWiki/Plugin/recentchanges.pm
parente1ce482e4146d1036e1ae512c73e54f69ff52f0d (diff)
use new refresh hook
Diffstat (limited to 'IkiWiki/Plugin/recentchanges.pm')
-rw-r--r--IkiWiki/Plugin/recentchanges.pm18
1 files changed, 7 insertions, 11 deletions
diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm
index 1c52a00f2..2525785e7 100644
--- a/IkiWiki/Plugin/recentchanges.pm
+++ b/IkiWiki/Plugin/recentchanges.pm
@@ -6,18 +6,17 @@ use strict;
use IkiWiki 2.00;
sub import { #{{{
- hook(type => "needsbuild", id => "recentchanges",
- call => \&needsbuild);
+ hook(type => "refresh", id => "recentchanges",
+ call => \&refresh);
hook(type => "preprocess", id => "recentchanges",
call => \&preprocess);
hook(type => "htmlize", id => "_change",
call => \&htmlize);
} #}}}
-sub needsbuild ($) { #{{{
- my $needsbuild=shift;
+sub refresh ($) { #{{{
my @changes=IkiWiki::rcs_recentchanges(100);
- push @$needsbuild, updatechanges("*", "recentchanges", \@changes);
+ updatechanges("*", "recentchanges", \@changes);
} #}}}
sub preprocess (@) { #{{{
@@ -98,21 +97,18 @@ sub store ($$) { #{{{
my $file=$page."._change";
writefile($file, $config{srcdir}, $template->output);
utime $change->{when}, $change->{when}, "$config{srcdir}/$file";
- return $file;
} #}}}
sub updatechanges ($$) { #{{{
my $pagespec=shift;
my $subdir=shift;
my @changes=@{shift()};
- my @ret;
+
foreach my $change (@changes) {
- my $file=store($change, $subdir);
- push @ret, $file if defined $file;
+ store($change, $subdir);
}
- # TODO: delete old
- return @ret;
+ # TODO: delete old
} #}}}
1