Files
max-richter.dev/src/pages/projects/index.astro
Max Richter 58b74bb801
Some checks failed
Deploy to GitHub Pages / build (push) Failing after 7m15s
Deploy to GitHub Pages / deploy (push) Has been skipped
feat: some shit
2024-04-03 18:07:54 +02:00

18 lines
556 B
Plaintext

---
import { getCollection } from "astro:content";
import Layout from "@layouts/Layout.astro";
import { getLocale } from "astro-i18n-aut";
import { filterCollection } from "@i18n/utils";
import HeroCard from "@components/HeroCard.astro";
const locale = getLocale(Astro.url);
const pages = await getCollection("projects");
const posts = filterCollection(pages, locale)
.sort((a, b) => (b.data.date > a.data.date ? 1 : -1))
.sort((a) => (a.data.featured ? -1 : 1));
---
<Layout title="Dude">
{posts.map((post) => <HeroCard post={post} />)}
</Layout>