feat: refactor blog components

This commit is contained in:
2026-02-16 22:26:53 -06:00
parent 505670dbf8
commit 6423ffba63
25 changed files with 476 additions and 460 deletions

View File

@@ -0,0 +1,36 @@
---
import type { Post } from '@lib/directusTypes';
import LargeBlogLeftCard from '@components/cards/LargeBlogLeftCard.astro';
import LargeBlogRightCard from '@components/cards/LargeBlogRightCard.astro';
import { getDirectusImageURL } from '@lib/directusFunctions';
interface Props {
posts: Post[];
}
const { posts } = Astro.props;
---
<section class="smooth-reveal">
{posts.map((b, index) => index % 2 === 0 ? (
<LargeBlogLeftCard
title={b.title}
subTitle={b.description}
url={`/blog/${b.slug}`}
img={getDirectusImageURL(b.image)}
imgAlt={b.image_alt}
/>
) : (
<LargeBlogRightCard
title={b.title}
subTitle={b.description}
url={`/blog/${b.slug}`}
single={!b.image_second}
imgOne={getDirectusImageURL(b.image)}
imgOneAlt={b.image_alt}
imgTwo={getDirectusImageURL(b?.image_second)}
imgTwoAlt={b?.image_second_alt}
/>
))};
</section>