mirror of
https://github.com/ClovertaTheTrilobita/SanYeCao-blog.git
synced 2026-04-01 17:50:13 +00:00
update timeline
This commit is contained in:
parent
f1dd997c9a
commit
67a574e8d9
1 changed files with 19 additions and 12 deletions
|
|
@ -43,18 +43,25 @@ const groupedPosts = filteredPosts.reduce((acc: any[], post: any) => {
|
|||
<p class="post-date">{group.month}</p>
|
||||
|
||||
<div class="month-posts">
|
||||
{group.posts.map((post: any) => (
|
||||
<a
|
||||
href={`/${lang}/posts/${post.id}/`}
|
||||
class="timeline-card"
|
||||
data-astro-reload
|
||||
>
|
||||
<h2 class="post-title">{post.data.title}</h2>
|
||||
<p class="post-description">
|
||||
{post.data.description}
|
||||
</p>
|
||||
</a>
|
||||
))}
|
||||
{group.posts.map((post: any) => {
|
||||
const [postLang, ...slugParts] = post.id.split("/");
|
||||
const slug = slugParts.join("/");
|
||||
|
||||
return (
|
||||
<a
|
||||
href={`/${lang}/posts/${slug}/`}
|
||||
class="timeline-card"
|
||||
data-astro-reload
|
||||
>
|
||||
<h2 class="post-title">
|
||||
{post.data.title}
|
||||
</h2>
|
||||
<p class="post-description">
|
||||
{post.data.description}
|
||||
</p>
|
||||
</a>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
|
|
|||
Loading…
Reference in a new issue