From eab80bd17a5f973f35dd2f18115605da6803b26f Mon Sep 17 00:00:00 2001 From: gbanyan Date: Wed, 19 Nov 2025 01:36:54 +0800 Subject: [PATCH] Render timeline ticks per card --- components/post-list-item.tsx | 72 ++++++++++++++++----------------- components/timeline-wrapper.tsx | 19 +++++---- 2 files changed, 47 insertions(+), 44 deletions(-) diff --git a/components/post-list-item.tsx b/components/post-list-item.tsx index 8950d30..8051a43 100644 --- a/components/post-list-item.tsx +++ b/components/post-list-item.tsx @@ -18,44 +18,42 @@ export function PostListItem({ post }: Props) { post.description || post.custom_excerpt || post.body?.raw?.slice(0, 120); return ( -
-
-
- {cover && ( -
- {/* eslint-disable-next-line @next/next/no-img-element */} - {post.title} -
- )} -
-
- {post.published_at && ( - - {new Date(post.published_at).toLocaleDateString( - siteConfig.defaultLocale - )} - - )} - {post.tags && post.tags.length > 0 && ( - - {post.tags.slice(0, 3).join(', ')} - - )} -
-

- {post.title} -

- {excerpt && ( -

- {excerpt} -

+
+
+ {cover && ( +
+ {/* eslint-disable-next-line @next/next/no-img-element */} + {post.title} +
+ )} +
+
+ {post.published_at && ( + + {new Date(post.published_at).toLocaleDateString( + siteConfig.defaultLocale + )} + + )} + {post.tags && post.tags.length > 0 && ( + + {post.tags.slice(0, 3).join(', ')} + )}
-
-
+

+ {post.title} +

+ {excerpt && ( +

+ {excerpt} +

+ )} +
+
); } diff --git a/components/timeline-wrapper.tsx b/components/timeline-wrapper.tsx index 980a42a..8b9eacf 100644 --- a/components/timeline-wrapper.tsx +++ b/components/timeline-wrapper.tsx @@ -1,4 +1,4 @@ -import { ReactNode } from 'react'; +import { Children, ReactNode } from 'react'; import clsx from 'clsx'; interface TimelineWrapperProps { @@ -7,21 +7,26 @@ interface TimelineWrapperProps { } export function TimelineWrapper({ children, className }: TimelineWrapperProps) { + const items = Children.toArray(children); return ( -
-