From 0b4fd72b7e20bbdcc46d104428a83ee4707c104d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateus=20Felipe=20Gon=C3=A7alves?= Date: Fri, 2 Dec 2022 13:42:13 -0300 Subject: [PATCH] feat: sort post list on category page --- src/pages/category/[category].tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/category/[category].tsx b/src/pages/category/[category].tsx index 7fedf1c7..1f67feb9 100644 --- a/src/pages/category/[category].tsx +++ b/src/pages/category/[category].tsx @@ -12,6 +12,7 @@ import { import { KnowledgeLink } from '../../components/KnowledgeLink' import { Post } from 'contentlayer/generated' +import { getSortedPosts } from 'src/lib/getSortedPosts' interface Props { category: string @@ -61,7 +62,7 @@ export const getStaticProps: GetStaticProps = async ({ params }) => { const category = params.category if (typeof category === 'string') { - const postList = getPostListOfCategory(category) + const postList = getSortedPosts(getPostListOfCategory(category)) return { props: {