From ba1193896f6dd22a5b6e822f3b57cfd116ed084f Mon Sep 17 00:00:00 2001 From: Atridad Lahiji Date: Tue, 3 Feb 2026 11:00:13 -0700 Subject: [PATCH] Improved posts UX --- src/pages/posts.astro | 163 ++++++++++------------------------------- src/pages/talks.astro | 167 +++++++++++------------------------------- 2 files changed, 83 insertions(+), 247 deletions(-) diff --git a/src/pages/posts.astro b/src/pages/posts.astro index e7c89f4..b4f612b 100644 --- a/src/pages/posts.astro +++ b/src/pages/posts.astro @@ -22,140 +22,55 @@ function formatDate(date: Date): string { --- -
+

Posts

- {/* Mobile: One-sided compact timeline */} - - - {/* Desktop: Dual-sided alternating timeline */} - - { - sortedPosts.length === 0 && ( + sortedPosts.length === 0 ? (

No posts available yet. Check back soon!

+ ) : ( +
    + {sortedPosts.map((post) => ( +
  • + + +
    + + {post.data.pubDate.toLocaleDateString("en-us", { month: "short", day: "numeric" })} + + + {post.data.pubDate.getFullYear()} + +
    + +
    +

    + {post.data.title} +

    +

    + {post.data.description || "No description available."} +

    + {post.data.tags && post.data.tags.length > 0 && ( +
    + {post.data.tags.slice(0, 3).map((tag: string) => ( + + {tag} + + ))} +
    + )} +
    +
  • + ))} +
) }
diff --git a/src/pages/talks.astro b/src/pages/talks.astro index b0bc3ed..c176099 100644 --- a/src/pages/talks.astro +++ b/src/pages/talks.astro @@ -19,139 +19,60 @@ function formatDate(dateStr: string): string { --- -
+

Talks

- {/* Single talk: Simple centered card without timeline */} - {sortedTalks.length === 1 && ( -
-
- {sortedTalks[0].date && ( - - )} - - -

- {sortedTalks[0].name} -

- -

- {sortedTalks[0].description} -

- - - - View talk - -
-
-
- )} - - {/* Multiple talks: Mobile one-sided compact timeline */} - {sortedTalks.length > 1 && ( - - )} - - {/* Multiple talks: Desktop dual-sided alternating timeline */} - {sortedTalks.length > 1 && ( - - )} - { - sortedTalks.length === 0 && ( + sortedTalks.length === 0 ? (

No talks available yet. Check back soon!

+ ) : ( +
    + {sortedTalks.map((talk) => { + const talkDate = talk.date ? new Date(talk.date) : null; + return ( +
  • + + +
    + {talkDate ? ( + <> + + {talkDate.toLocaleDateString("en-us", { month: "short", day: "numeric" })} + + + {talkDate.getFullYear()} + + + ) : ( + Undated + )} +
    + +
    +

    + {talk.name} + +

    +

    + {talk.description} +

    +
    +
  • + ); + })} +
) }