--- // init i18n import { l, t, astroI18n } from "astro-i18n"; astroI18n.init(Astro); // import stuff import BaseLayout from "../layouts/BaseLayout.astro"; import QuickAccessCard from "../components/QuickAccessCard.astro"; import ListCards from "../components/ListCards.astro"; const pageTitle = t("accueil"); // get all HP sections const allSections = await Astro.glob("../data/HP/**/*.md"); // only keep the right locale version const localizedSections = allSections.filter((section) => { return section.frontmatter.lang === astroI18n.langCode; }); // get all articles const allArticles = await Astro.glob("../data/articles/**/*.{md,mdx}"); // only keep the right locale version const localizedArticles = allArticles.filter((article) => { return article.frontmatter.lang === astroI18n.langCode; }); // sort articles by descending publication date const sortedArticles = localizedArticles.sort( (a, b) => b.frontmatter.pubDate - a.frontmatter.pubDate ); // New astro content collections import { getCollection } from "astro:content"; // Only return posts with `draft: true` in the frontmatter const newLocalizedArticles = await getCollection("articles", ({ data }) => { return data.lang === astroI18n.langCode; }); --- {t("index.subtitle")} { localizedSections.map((section) => ( )) } { localizedSections.map((section) => ( )) } {t("index.latestArticles")}