Skip to content
Snippets Groups Projects
Verified Commit 276712b7 authored by jindra12's avatar jindra12
Browse files

Add shared articles to feeds

parent 7263a6c7
No related branches found
No related tags found
2 merge requests!816Release,!801Prepare basic shared tags
Pipeline #13886 passed
......@@ -22,7 +22,11 @@ class LatestArticlesFeed(Feed):
return obj.perex
def items(self, obj: MainArticlesPage) -> list:
return MainArticlePage.objects.live().child_of(obj).order_by("-date")[:32]
return obj.materialize_shared_articles_query(
obj.append_all_shared_articles_query(MainArticlePage.objects.child_of(obj))[
:32
]
)
def item_title(self, item: MainArticlePage) -> str:
return item.title
......@@ -52,10 +56,10 @@ class LatestArticlesFeed(Feed):
return ""
def item_categories(self, item: MainArticlePage) -> list:
return item.tags.all()
return item.get_tags() if callable(item.get_tags) else item.get_tags
def item_link(self, item: MainArticlePage) -> str:
return item.get_full_url()
return item.get_full_url
def item_enclosure_url(self, item: MainArticlePage) -> typing.Union[None, str]:
if item.image is None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment