X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/45a5e8e972b3f56fbc2b32aa7b9c218c076da7e3..cedf2c0af568d801fe2cf1917ac0202ce64f838b:/IkiWiki/Plugin/aggregate.pm diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm index e473fc643..9b70e5df0 100644 --- a/IkiWiki/Plugin/aggregate.pm +++ b/IkiWiki/Plugin/aggregate.pm @@ -210,6 +210,8 @@ sub needsbuild (@) { markunseen($feed->{sourcepage}); } } + + return $needsbuild; } sub preprocess (@) { @@ -359,14 +361,9 @@ sub savestate () { my $timestamp=undef; foreach my $feed (keys %feeds) { - if (defined $feeds{$feed}->{lastupdate}) { - my $t=$feeds{$feed}->{lastupdate}+$feeds{$feed}->{updateinterval}; - if (! defined $timestamp || $timestamp > $t) { - $timestamp=$t; - } - } - else { - $timestamp=0; + my $t=$feeds{$feed}->{lastupdate}+$feeds{$feed}->{updateinterval}; + if (! defined $timestamp || $timestamp > $t) { + $timestamp=$t; } } $newfile=~s/\.new$/time/; @@ -647,7 +644,14 @@ sub add_page (@) { $guid->{md5}=$digest; # Create the page. - my $template=template($feed->{template}, blind_cache => 1); + my $template; + eval { + $template=template($feed->{template}, blind_cache => 1); + }; + if ($@) { + print STDERR gettext("failed to process template:")." $@"; + return; + } $template->param(title => $params{title}) if defined $params{title} && length($params{title}); $template->param(content => wikiescape(htmlabs($params{content},