diff options
-rw-r--r-- | app/builder/views.py | 5 | ||||
-rw-r--r-- | app/posts/build.py | 13 |
2 files changed, 17 insertions, 1 deletions
diff --git a/app/builder/views.py b/app/builder/views.py index b50bcb3..27385aa 100644 --- a/app/builder/views.py +++ b/app/builder/views.py @@ -6,7 +6,7 @@ from resume.build import pub_builder, resume_builder from books.build import builder as book_builder from sightings.build import builder as sightings_builder from pages.build import BuildPages, BuildHome -from posts.build import BuildJrnl, BuildFieldNotes, BuildSrc, BuildGuide +from posts.build import BuildJrnl, BuildFieldNotes, BuildSrc, BuildGuide, BuildEssays from lttr.build import lttr_builder def do_build(request): @@ -26,6 +26,9 @@ def do_build(request): elif section == 'homepage': context = {'message': 'Writing index to Disk'} BuildHome("pages", "homepage").build() + elif section == 'essays': + context = {'message': 'Writing essays to Disk'} + BuildEssays("posts", "post").build() elif section == 'src': context = {'message': 'Writing src section to Disk'} BuildSrc("posts", "post").build() diff --git a/app/posts/build.py b/app/posts/build.py index 47a6efe..7bd191a 100644 --- a/app/posts/build.py +++ b/app/posts/build.py @@ -108,3 +108,16 @@ class BuildJrnl(BuildNew): def build_latest(self): response = self.client.get('/jrnl/latest/') self.write_file(reverse("jrnl:latest"), response.content) + + +class BuildEssays(BuildNew): + + def get_model_queryset(self): + return self.model.objects.filter(post_type=PostType.ESSAY).filter(status__exact=1).order_by('-pub_date') + + def build(self): + self.build_list_view( + base_path=reverse("essays:list"), + paginate_by=50 + ) + self.build_detail_view() |