Files
website/src/pages/blog/index.astro

28 lines
548 B
Plaintext

---
import { getCollection } from "astro:content";
const pages = await getCollection("blog");
import Layout from "@layouts/Layout.astro";
import { getLocale } from "astro-i18n-aut";
import { filterCollection } from "@i18n/utils";
const locale = getLocale(Astro.url);
const posts = filterCollection(pages, locale);
---
<Layout title="Dude">
<hr />
{
posts.map((post) => (
<>
<>
<a href={"blog/" + post.slug.split("/")[0]}>{post.data.title}</a>
<br />
</>
</>
))
}
<hr />
</Layout>