mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Adds the category to the feed item. Fix #2556.
Adds the article category as a feed item category.
This commit is contained in:
parent
b6514dcb47
commit
f72d06a4a5
1 changed files with 7 additions and 1 deletions
|
|
@ -78,13 +78,19 @@ class Writer(object):
|
||||||
if description == content:
|
if description == content:
|
||||||
description = None
|
description = None
|
||||||
|
|
||||||
|
categories = list()
|
||||||
|
if hasattr(item, 'category'):
|
||||||
|
categories.append(item.category)
|
||||||
|
if hasattr(item, 'tags'):
|
||||||
|
categories.extend(item.tags)
|
||||||
|
|
||||||
feed.add_item(
|
feed.add_item(
|
||||||
title=title,
|
title=title,
|
||||||
link=link,
|
link=link,
|
||||||
unique_id=get_tag_uri(link, item.date),
|
unique_id=get_tag_uri(link, item.date),
|
||||||
description=description,
|
description=description,
|
||||||
content=content,
|
content=content,
|
||||||
categories=item.tags if hasattr(item, 'tags') else None,
|
categories=categories if categories else None,
|
||||||
author_name=getattr(item, 'author', ''),
|
author_name=getattr(item, 'author', ''),
|
||||||
pubdate=set_date_tzinfo(
|
pubdate=set_date_tzinfo(
|
||||||
item.date, self.settings.get('TIMEZONE', None)),
|
item.date, self.settings.get('TIMEZONE', None)),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue