Make "content" available in the template.

Depending on the feed, the adding content could be more
appropriate. Leave this choice to the user.
This commit is contained in:
Hartmut Goebel
2019-03-30 22:05:50 +01:00
parent 03d48992c7
commit ae78c8c16f

View File

@ -130,6 +130,7 @@ def get_entry(entry, generator=None):
for t in tag['term'].split(): for t in tag['term'].split():
hashtags.append('#' + t) hashtags.append('#' + t)
summary = entry.get('summary', '') summary = entry.get('summary', '')
content = entry.get('content', '')
url = entry.id url = entry.id
if generator == "wordpress": if generator == "wordpress":
links = [l for l in entry.links if l.get("rel") == "alternate"] links = [l for l in entry.links if l.get("rel") == "alternate"]
@ -141,6 +142,7 @@ def get_entry(entry, generator=None):
'url': url, 'url': url,
'title': BeautifulSoup(entry.title, 'html.parser').get_text(), 'title': BeautifulSoup(entry.title, 'html.parser').get_text(),
'summary': BeautifulSoup(summary, 'html.parser').get_text(), 'summary': BeautifulSoup(summary, 'html.parser').get_text(),
'content': BeautifulSoup(summary, 'html.parser').get_text(),
'hashtags': ' '.join(hashtags), 'hashtags': ' '.join(hashtags),
'updated': dateutil.parser.parse(entry['updated']), 'updated': dateutil.parser.parse(entry['updated']),
'images': collect_images(entry), 'images': collect_images(entry),