diff options
Diffstat (limited to 'app/jrnl')
-rw-r--r-- | app/jrnl/build.py | 1 | ||||
-rw-r--r-- | app/jrnl/models.py | 9 | ||||
-rw-r--r-- | app/jrnl/urls.py | 5 | ||||
-rw-r--r-- | app/jrnl/views.py | 12 |
4 files changed, 18 insertions, 9 deletions
diff --git a/app/jrnl/build.py b/app/jrnl/build.py index 504e288..7bebc13 100644 --- a/app/jrnl/build.py +++ b/app/jrnl/build.py @@ -15,6 +15,7 @@ class BuildJrnl(BuildNew): self.build_month_view("jrnl:list_month") self.build_detail_view() self.build_location_view() + self.build_feed("jrnl:feed") def build_location_view(self): c = apps.get_model('locations', 'Country') diff --git a/app/jrnl/models.py b/app/jrnl/models.py index 2f84798..0deb8d3 100644 --- a/app/jrnl/models.py +++ b/app/jrnl/models.py @@ -195,15 +195,6 @@ class BlogSitemap(Sitemap): return obj.pub_date -class LatestFull(Feed): - title = "Luxagraf: Topographical Writings" - link = "/writing/" - description = "Latest postings to luxagraf.net" - description_template = 'feeds/blog_description.html' - - def items(self): - return Entry.objects.filter(status__exact=1).order_by('-pub_date')[:10] - import urllib.request import urllib.parse diff --git a/app/jrnl/urls.py b/app/jrnl/urls.py index 2b17033..09c7b7c 100644 --- a/app/jrnl/urls.py +++ b/app/jrnl/urls.py @@ -5,6 +5,11 @@ from . import views urlpatterns = [ url( + regex=r'^feed.xml', + view=views.JrnlRSSFeedView(), + name="feed" + ), + url( regex=r'(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[-\w]+).txt$', view=views.EntryDetailViewTXT.as_view(), name="detail-txt" diff --git a/app/jrnl/views.py b/app/jrnl/views.py index 634a375..893c7ea 100644 --- a/app/jrnl/views.py +++ b/app/jrnl/views.py @@ -1,6 +1,7 @@ from django.views.generic import ListView from django.views.generic.detail import DetailView from django.views.generic.dates import YearArchiveView, MonthArchiveView +from django.contrib.syndication.views import Feed from django.conf import settings @@ -106,3 +107,14 @@ class HomepageList(ListView): context['homepage'] = HomepageCurrator.objects.get(pk=1) context['IMAGES_URL'] = settings.IMAGES_URL return context + + +class JrnlRSSFeedView(Feed): + title = "Luxagraf: Topographical Writings" + link = "/writing/" + description = "Latest postings to luxagraf.net" + description_template = 'feeds/blog_description.html' + + def items(self): + return Entry.objects.filter(status__exact=1).order_by('-pub_date')[:10] + |