| |
@@ -20,6 +20,11 @@
|
| |
# removing '[...]' from the summary, so its cleaner
|
| |
summary = item.summary.rstrip(' […]').replace("’", "'").replace("’", "'")
|
| |
item.title = item.title.replace("&", "&")
|
| |
+ # find the first image enclosure
|
| |
+ for image_enclosure in item.enclosures:
|
| |
+ if image_enclosure['type'] == 'image/jpg':
|
| |
+ break
|
| |
+
|
| |
html += """
|
| |
<div class="hidden-xs col-sm-1 top-margin">
|
| |
<p class="month">%s</p>
|
| |
@@ -44,7 +49,7 @@
|
| |
</div>
|
| |
</div>
|
| |
</div>
|
| |
- """ % (item.updated.split()[2], item.updated.split()[1], item.enclosures[0].href.replace("&", "&"), item.links[0]['href'], item.title,
|
| |
+ """ % (item.updated.split()[2], item.updated.split()[1], image_enclosure.href.replace("&", "&"), item.links[0]['href'], item.title,
|
| |
item.slash_comments, summary, item.links[0]['href'])
|
| |
#print item.content
|
| |
#break
|
| |
for start.fedoraprojectorg
This commit iterates over the enclosure tags of each article, and uses
the first one whose
type
attribute is 'image/jpg'.In the case no enclosure with this criteria is found, it will use the
last enclosure in the list.
Fixes issue #1045