Skip to content

Commit

Permalink
feat: sort post list on index page
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusfg7 committed Dec 2, 2022
1 parent 3eb1a40 commit f1aeabd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ import { Header } from '../components/Header'
import { KnowledgeLink } from '../components/KnowledgeLink'

import { allPosts } from 'contentlayer/generated'
import { getSortedPosts } from 'src/lib/getSortedPosts'

const Home = () => {
const posts = getSortedPosts(allPosts)

return (
<div>
<Head>
Expand All @@ -17,7 +20,7 @@ const Home = () => {
<Container>
<Header title="Knowledge" />
<main>
{allPosts.map((post, key) => {
{posts.map((post, key) => {
return (
<KnowledgeLink
key={key}
Expand Down

0 comments on commit f1aeabd

Please sign in to comment.