From 74ff789b5c6625804124971b5045f7cae49ff238 Mon Sep 17 00:00:00 2001 From: Jonathan DeMasi Date: Sun, 8 Mar 2020 12:48:42 -0600 Subject: clean up some locations of things --- blog/models.py | 3 ++- blog/templates/blog/blog_index_page.html | 11 +---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/blog/models.py b/blog/models.py index d53fb64..e34ca58 100644 --- a/blog/models.py +++ b/blog/models.py @@ -24,7 +24,8 @@ class BlogIndexPage(Page): def get_context(self, request): # Update context to include only published posts, ordered by reverse-chron context = super().get_context(request) - blogpages = self.get_children().live().order_by('-first_published_at') + # We have to add the type because we want tags and categories to live under blog + blogpages = self.get_children().live().order_by('-first_published_at').type(BlogPost) paginator = Paginator(blogpages, 5) # Try to get the ?page=x value page = request.GET.get("page") diff --git a/blog/templates/blog/blog_index_page.html b/blog/templates/blog/blog_index_page.html index 3a36238..d58d1a9 100644 --- a/blog/templates/blog/blog_index_page.html +++ b/blog/templates/blog/blog_index_page.html @@ -60,21 +60,12 @@ {% endif %} {% endif %} -
- {% include "search.html" %} - -
- - - - - - + {% endblock %} -- cgit v1.2.3