-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: gitworkflows <118260833+gitworkflows@users.noreply.github.com>
- Loading branch information
1 parent
90af2ab
commit a684bc9
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import Link from 'next/link' | ||
import { formatDate, getBlogPosts } from 'app/blog/utils' | ||
|
||
export function BlogPosts() { | ||
let allBlogs = getBlogPosts() | ||
|
||
return ( | ||
<div> | ||
{allBlogs | ||
.sort((a, b) => { | ||
if ( | ||
new Date(a.metadata.publishedAt) > new Date(b.metadata.publishedAt) | ||
) { | ||
return -1 | ||
} | ||
return 1 | ||
}) | ||
.map((post) => ( | ||
<Link | ||
key={post.slug} | ||
className="flex flex-col space-y-1 mb-4" | ||
href={`/blog/${post.slug}`} | ||
> | ||
<div className="w-full flex flex-col md:flex-row space-x-0 md:space-x-2"> | ||
<p className="text-neutral-600 dark:text-neutral-400 w-[100px] tabular-nums"> | ||
{formatDate(post.metadata.publishedAt, false)} | ||
</p> | ||
<p className="text-neutral-900 dark:text-neutral-100 tracking-tight"> | ||
{post.metadata.title} | ||
</p> | ||
</div> | ||
</Link> | ||
))} | ||
</div> | ||
) | ||
} |
a684bc9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
hand-pickr – ./
hand-pickr-devsec.vercel.app
hand-pickr.vercel.app
hand-pickr-git-main-devsec.vercel.app