]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/aggregate.pm
aggregate: Support atom feeds with only a summary element, and no content elements.
[ikiwiki.git] / IkiWiki / Plugin / aggregate.pm
index 2f20ad2e56411d1f4b0463c3781258db1e338500..c1421f24612863014a5a8f53ecb3c4bb1aab708f 100644 (file)
@@ -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,
                        );