mirror of
https://github.com/maciejpedzich/maciejpedzi.ch.git
synced 2024-11-27 15:45:47 +01:00
Ensure "no posts" message doesn't get placed in ul
This commit is contained in:
parent
6a35c00298
commit
d5a7b418a3
@ -16,16 +16,22 @@ const posts = (
|
||||
).sort((a, b) => a.data.pubDate.valueOf() - b.data.pubDate.valueOf());
|
||||
---
|
||||
|
||||
<ul class="post-list">
|
||||
{
|
||||
posts.length === 0 ? (
|
||||
<p>No posts were found</p>
|
||||
) : (
|
||||
posts.map((post) => (
|
||||
{
|
||||
posts.length === 0 ? (
|
||||
<p id="no-posts-found">No posts were found...</p>
|
||||
) : (
|
||||
<ul class="post-list">
|
||||
{posts.map((post) => (
|
||||
<li>
|
||||
<a href={`/blog/${post.slug}`}>{post.data.title}</a>
|
||||
</li>
|
||||
))
|
||||
)
|
||||
))}
|
||||
</ul>
|
||||
)
|
||||
}
|
||||
|
||||
<style>
|
||||
#no-posts-found {
|
||||
text-align: center;
|
||||
}
|
||||
</ul>
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user