Skip to content

Commit

Permalink
fix: show recent posts on about page
Browse files Browse the repository at this point in the history
  • Loading branch information
arevalolance committed Oct 1, 2023
1 parent 43a51db commit 5edbc38
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/about/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ export default async function About() {

<div className="flex flex-col">
{allBlogs
// sorts by latest
.sort((a, b) => {
if (new Date(a.publishedAt) < new Date(b.publishedAt)) {
return -1
}
return 1
})
.slice(-3)
.reverse()
.map((item) => (
Expand Down
2 changes: 1 addition & 1 deletion content/hello-again.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "Hello, again"
publishedAt: "2023-07-24"
summary: "A lot of things have changed in a few months. Learn more about the creator of this website in this short re-introductory post."
image: "/static/images/posts/hello-again.png"
topic: "Others"
topic: Others
---

Hey there,
Expand Down

1 comment on commit 5edbc38

@vercel
Copy link

@vercel vercel bot commented on 5edbc38 Oct 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.