diff --git a/main/feeds.py b/main/feeds.py index 4b6c9d63d8efe44c83d0679f30f1acaf9d593d40..5b052f185a66e381824470cd2244200cec24f292 100644 --- a/main/feeds.py +++ b/main/feeds.py @@ -51,6 +51,24 @@ class LatestArticlesFeed(Feed): {"item": item}, ) + def item_pubdate( + self: LatestArticlesFeed, + item: MainArticlePage + ): + return item.first_published_at + + def item_updateddate( + self: LatestArticlesFeed, + item: MainArticlePage + ): + return item.last_published_at + + def item_categories( + self: LatestArticlesFeed, + item: MainArticlePage + ) -> list: + return item.tags.all() + def item_link( self: LatestArticlesFeed, item: MainArticlePage diff --git a/main/urls.py b/main/urls.py new file mode 100644 index 0000000000000000000000000000000000000000..69792634cfc651626b12cb75d89c0318c1a8bdf4 --- /dev/null +++ b/main/urls.py @@ -0,0 +1,7 @@ +from django.urls import path +from main.feeds import LatestArticlesFeed + + +urlpatterns = [ + path('feed', LatestArticlesFeed()), +]