--- import Layout from "@layouts/Layout.astro"; import Max from "@components/Max.astro"; import { getCollection } from "astro:content"; import { filterCollection, useTranslatedPath, useTranslations, } from "@i18n/utils"; import { getLocale } from "astro-i18n-aut"; import HeroCard from "@components/HeroCard.astro"; import SmallCard from "@components/SmallCard.astro"; import LinkCard from "@components/LinkCard.astro"; import ArrowA from "@components/arrows/ArrowA.astro"; import ArrowB from "@components/arrows/ArrowB.astro"; const projects = filterCollection( await getCollection("projects"), getLocale(Astro.url), ); const t = useTranslations(Astro.url); const tp = useTranslatedPath(Astro.url); const featuredProject = projects.find((project) => project.data?.featured); const otherProjects = projects .filter((project) => featuredProject !== project) .sort((a) => (a?.data?.icon ? -1 : 1)) .slice(0, 3); const posts = filterCollection( await getCollection("blog"), getLocale(Astro.url), ); const featuredPost = posts.find((post) => post.data?.featured); const otherPosts = posts.filter((post) => featuredPost !== post).slice(0, 3); ---
{featuredProject && }
{ otherProjects.length > 0 && otherProjects.map((project) => ) }
{featuredPost && }
{ otherPosts.length > 0 && otherPosts.map((post) => ) }