+ikiwiki (3.20200202.4) UNRELEASED; urgency=medium
+
+ * aggregate: When a feed has an enclosure that is an image, audio, or
+ video, include the enclosure in the generated page.
+
+ -- Joey Hess <id@joeyh.name> Sat, 25 Dec 2021 12:41:34 -0400
+
ikiwiki (3.20200202.3) upstream; urgency=medium
[ Amitai Schleier ]
title => defined $entry->title ? decode_entities($entry->title) : "untitled",
author => defined $entry->author ? decode_entities($entry->author) : "",
link => $entry->link,
+ enclosureurl => defined $entry->enclosure ? $entry->enclosure->url : "",
+ enclosureimage => (defined $entry->enclosure && $entry->enclosure->type =~ m/image\//) ? "1" : "",
+ enclosureaudio => (defined $entry->enclosure && $entry->enclosure->type =~ m/audio\//) ? "1" : "",
+ enclosurevideo => (defined $entry->enclosure && $entry->enclosure->type =~ m/video\//) ? "1" : "",
content => (defined $c && defined $c->body) ? $c->body : "",
guid => defined $entry->id ? $entry->id : time."_".$feed->{name},
ctime => $entry->issued ? ($entry->issued->epoch || time) : time,
if defined $params{copyright} && length $params{copyright};
$template->param(permalink => IkiWiki::urlabs($params{link}, $feed->{feedurl}))
if defined $params{link};
+ $template->param(enclosureurl => $params{enclosureurl})
+ if defined $params{enclosureurl} && length $params{enclosureurl};
+ $template->param(enclosureimage => $params{enclosureimage})
+ if defined $params{enclosureimage} && length $params{enclosureimage};
+ $template->param(enclosureaudio => $params{enclosureaudio})
+ if defined $params{enclosureaudio} && length $params{enclosureaudio};
+ $template->param(enclosurevideo => $params{enclosurevideo})
+ if defined $params{enclosurevideo} && length $params{enclosurevideo};
if (ref $feed->{tags}) {
$template->param(tags => [map { tag => $_ }, @{$feed->{tags}}]);
}
<TMPL_VAR CONTENT>
+<TMPL_IF ENCLOSUREURL>
+<TMPL_IF ENCLOSUREIMAGE>
+<img src="<TMPL_VAR ENCLOSUREURL ESCAPE=HTML>" width="50%" />
+</TMPL_IF>
+<TMPL_IF ENCLOSUREAUDIO>
+<audio controls src="<TMPL_VAR ENCLOSUREURL ESCAPE=HTML>" />
+</TMPL_IF>
+<TMPL_IF ENCLOSUREVIDEO>
+<video controls src="<TMPL_VAR ENCLOSUREURL ESCAPE=HTML>" width="50%" />
+</TMPL_IF>
+</TMPL_IF>
<TMPL_LOOP TAGS>
[[!tag <TMPL_VAR TAG>]]
</TMPL_LOOP>