This commit is contained in:
2024-06-19 22:58:55 +03:00
parent fcf89a9cc5
commit 54344f1497
152 changed files with 18665 additions and 5 deletions

View File

@@ -0,0 +1,44 @@
---
import type { CollectionEntry } from 'astro:content'
import LeftSection from './blocks/LeftSection.astro'
import RightSection from './blocks/RightSection.astro'
const { blogs } = Astro.props
interface Props {
blogs: CollectionEntry<'posts'>[]
}
const posts = blogs.slice(0, 5)
---
{
posts.map((b, index) => index % 2 === 0
? (
<LeftSection
title={b.data.title}
subTitle={b.data.description}
btnExists={true}
btnTitle="Подробнее"
btnURL=`/posts/${b.slug}`
img={b.data.banner}
imgAlt={b.data.title}
/>
)
: (
<RightSection
title={b.data.title}
subTitle={b.data.description}
btnExists={true}
btnTitle="Подробнее"
btnURL=`/posts/${b.slug}`
img={b.data.banner}
imgAlt={b.data.title}
single={!b.data.banner2}
imgOne={b.data.banner}
imgOneAlt={b.data.title}
imgTwo={b.data?.banner2}
imgTwoAlt={b.data.title}
/>
))
}