From e6d4e34a0a55260c0f2ee1d166cb6eabcf8f1f61 Mon Sep 17 00:00:00 2001 From: Alex Lebens Date: Fri, 6 Mar 2026 22:31:33 -0600 Subject: [PATCH] feat: improve layout for single and two images --- src/components/cards/LargeBlogLeftCard.astro | 6 +- src/components/cards/LargeBlogRightCard.astro | 81 +++++++++++-------- .../sections/SelectedPostsSection.astro | 3 +- src/pages/blog/index.astro | 2 +- 4 files changed, 51 insertions(+), 41 deletions(-) diff --git a/src/components/cards/LargeBlogLeftCard.astro b/src/components/cards/LargeBlogLeftCard.astro index 3d24464..74b6919 100644 --- a/src/components/cards/LargeBlogLeftCard.astro +++ b/src/components/cards/LargeBlogLeftCard.astro @@ -15,15 +15,15 @@ interface Props { const { title, subTitle, url, img, imgAlt } = Astro.props; --- -
+ - {single ? ( + {!imgTwo ? (
{imgOneAlt}
) : ( -
- {imgOneAlt} - {imgTwoAlt} -
+ <> +
+ {imgOneAlt} +
+ + )}
diff --git a/src/components/sections/SelectedPostsSection.astro b/src/components/sections/SelectedPostsSection.astro index 8011dbf..75de08b 100644 --- a/src/components/sections/SelectedPostsSection.astro +++ b/src/components/sections/SelectedPostsSection.astro @@ -11,7 +11,7 @@ interface Props { const { posts } = Astro.props; --- -
+
{posts.map((post, index) => index % 2 === 0 ? ( p.selected).slice(0, 3); +const selectedPosts: Post[] = posts.filter((p) => p.selected).slice(0, 2); const recentPosts: Post[] = posts.filter( (p) => !selectedPosts.some((selected) => selected.slug === p.slug) ).slice(0, 9);