feat(pages.py): add posts ctx variable to BlogIndexPage

This commit is contained in:
2026-04-23 19:53:41 +02:00
parent 80a80553fe
commit 4c21e324f6

View File

@@ -33,6 +33,11 @@ class HomePage(Page):
class BlogIndexPage(Page):
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):
subpage_types = ["home.CoursePage"]