mirror of
https://github.com/thiloho/thiloho.github.io.git
synced 2025-11-22 02:11:35 +01:00
Destructure in maps for less duplication
This commit is contained in:
@@ -15,15 +15,12 @@ const sortedArticles = allArticles.sort((a, b) => {
|
||||
>
|
||||
<ul>
|
||||
{
|
||||
sortedArticles.map((article) => (
|
||||
sortedArticles.map(({ id, data: { title, pubDate } }) => (
|
||||
<li>
|
||||
<Date date={article.data.pubDate} />
|
||||
<Date date={pubDate} />
|
||||
<span>»</span>
|
||||
<a
|
||||
class="text-blue-800 hover:no-underline"
|
||||
href={`/blog/${article.id}`}
|
||||
>
|
||||
{article.data.title}
|
||||
<a class="text-blue-800 hover:no-underline" href={`/blog/${id}`}>
|
||||
{title}
|
||||
</a>
|
||||
</li>
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user