Skip to content

Commit

Permalink
feat: sort post list on category page
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusfg7 committed Dec 2, 2022
1 parent f1aeabd commit 0b4fd72
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/category/[category].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: {
Expand Down

0 comments on commit 0b4fd72

Please sign in to comment.