]> sipb.mit.edu Git - ikiwiki.git/commitdiff
use new refresh hook
authorJoey Hess <joey@kodama.kitenet.net>
Tue, 29 Jan 2008 18:08:48 +0000 (13:08 -0500)
committerJoey Hess <joey@kodama.kitenet.net>
Tue, 29 Jan 2008 18:08:48 +0000 (13:08 -0500)
IkiWiki/Plugin/recentchanges.pm

index 1c52a00f2e25cf54b301c629d323070d370fb7cc..2525785e7dea0d1d219c29ede9ed99f2550012b1 100644 (file)
@@ -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