aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-09-17 15:56:58 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-09-17 15:56:58 -0400
commit1cb4154bc8131ed317802ec9d39490237cd64462 (patch)
tree69c937b4184bc7f347c8f1b3fe54a992950ee0b6 /IkiWiki/Plugin
parent0ca6aef1e9db412c03288a069ebfa7c91d0b2468 (diff)
downloadikiwiki-1cb4154bc8131ed317802ec9d39490237cd64462.tar
ikiwiki-1cb4154bc8131ed317802ec9d39490237cd64462.tar.gz
aggregate: Support atom feeds with only a summary element, and no content elements.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/aggregate.pm8
1 files changed, 7 insertions, 1 deletions
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,
);