feat(pages.py): add posts ctx variable to BlogIndexPage
This commit is contained in:
@@ -33,6 +33,11 @@ class HomePage(Page):
|
|||||||
class BlogIndexPage(Page):
|
class BlogIndexPage(Page):
|
||||||
subpage_types = ["home.BlogPage"]
|
subpage_types = ["home.BlogPage"]
|
||||||
|
|
||||||
|
def get_context(self, request):
|
||||||
|
context = super().get_context(request)
|
||||||
|
context["posts"] = self.get_children().live().order_by("-first_published_at")
|
||||||
|
return context
|
||||||
|
|
||||||
|
|
||||||
class CourseIndexPage(Page):
|
class CourseIndexPage(Page):
|
||||||
subpage_types = ["home.CoursePage"]
|
subpage_types = ["home.CoursePage"]
|
||||||
|
|||||||
Reference in New Issue
Block a user