From 1cb4154bc8131ed317802ec9d39490237cd64462 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 17 Sep 2008 15:56:58 -0400 Subject: aggregate: Support atom feeds with only a summary element, and no content elements. --- IkiWiki/Plugin/aggregate.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'IkiWiki/Plugin') diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm index 2f20ad2e5..c1421f246 100644 --- a/IkiWiki/Plugin/aggregate.pm +++ b/IkiWiki/Plugin/aggregate.pm @@ -520,12 +520,18 @@ sub aggregate (@) { #{{{ } foreach my $entry ($f->entries) { + my $content=$content=$entry->content; + # atom feeds may have no content, only a summary + if (! defined $content) { + $content=$entry->summary; + } + add_page( feed => $feed, copyright => $f->copyright, title => defined $entry->title ? decode_entities($entry->title) : "untitled", link => $entry->link, - content => defined $entry->content->body ? $entry->content->body : "", + content => defined $content ? $content->body : "", guid => defined $entry->id ? $entry->id : time."_".$feed->{name}, ctime => $entry->issued ? ($entry->issued->epoch || time) : time, ); -- cgit v1.2.3