diff --git a/static/src/scss/_similar_content.scss b/static/src/scss/_similar_content.scss index d9f5af9..b0add4f 100644 --- a/static/src/scss/_similar_content.scss +++ b/static/src/scss/_similar_content.scss @@ -4,10 +4,14 @@ section#similar-content { align-items: center; margin-top: 2rem; - h2 { + .subtitle { color: inherit; } + .view-all { + margin: $block-spacing 0; + } + .media { @include desktop { transform: scale(85%); diff --git a/website/blog/models.py b/website/blog/models.py index b417082..acec431 100644 --- a/website/blog/models.py +++ b/website/blog/models.py @@ -68,6 +68,10 @@ class BlogPostPage(BaseContentPage): def tag_list_page_url(self) -> Optional[str]: return SingletonPageCache.get_url(BlogPostTagListPage) + @cached_property + def blog_post_list_page_url(self) -> Optional[str]: + return SingletonPageCache.get_url(BlogPostListPage) + def get_similar_posts(self) -> models.QuerySet: try: listing_pages = BlogPostListPage.objects.get().get_listing_pages() diff --git a/website/blog/templates/blog/blog_post_page.html b/website/blog/templates/blog/blog_post_page.html index b960eb9..2b40811 100644 --- a/website/blog/templates/blog/blog_post_page.html +++ b/website/blog/templates/blog/blog_post_page.html @@ -15,6 +15,10 @@ {% include "common/listing-item.html" %} {% endblock %} {% endfor %} + +
+ View all → +
{% endcache %} {% endif %} diff --git a/website/blog/tests.py b/website/blog/tests.py index 626cc0b..51ffce2 100644 --- a/website/blog/tests.py +++ b/website/blog/tests.py @@ -17,7 +17,7 @@ class BlogPostPageTestCase(TestCase): self.assertEqual(response.status_code, 200) def test_queries(self) -> None: - with self.assertNumQueries(45): + with self.assertNumQueries(47): self.client.get(self.page.url)