Skip to content

Commit

Permalink
feat: improve blog preview (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
load1n9 authored Dec 6, 2024
1 parent 7957fcb commit 92f125e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion components/BlogPreviewList.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@
margin-top: 1rem;
}

.post {
list-style: none;
}

.meta {
display: block;
font-size: 0.9rem;
color: var(--neutral-800);
white-space: pre-wrap;
}
}
7 changes: 5 additions & 2 deletions components/BlogPreviewList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ export function BlogPreviewList() {
return (
<ul class={classes.list}>
{allPosts.slice(0, 5).map((post) => (
<div class={classes.post}>
<li class={classes.post}>
<a href={href(post.file)}>{post.meta.title}</a>
<time datetime={post.meta.date.toString()} class={classes.meta}>
{post.meta.date.toLocaleString("sv-SE")}
</time>
</div>
</li>
))}
<a href="/blog">
View all posts
</a>
</ul>
);
}

0 comments on commit 92f125e

Please sign in to comment.