--- import { getCollection, getEntry } from "astro:content"; import NewsCard from "../cards/NewsCard.astro"; import Button from "../ui/Button.astro"; const { props } = Astro.props; const currentLocale = Astro.currentLocale; const newsItems = await getCollection("news", (post)=>{ const currentLocale = Astro.currentLocale; return post.data.locale == currentLocale }); import { createTranslator, t } from '../../i18n'; const tl = createTranslator(Astro.currentLocale); ---

{tl("news.title")}

{tl("news.text")}

{tl("news.text2")}

{ [...newsItems] .sort((a, b) => new Date(b.data.date).getTime() - new Date(a.data.date).getTime() ) .slice(0,6) .map((item) => ( )) }