website-astro/src/pages/veille/index.astro

44 lines
1021 B
Plaintext

---
import { t, astroI18n } from "astro-i18n";
astroI18n.init(Astro);
const pageTitle = t("index.veille.pageName");
import BaseLayout from "../../layouts/BaseLayout.astro";
import MetaDate from "../../components/MetaDate.astro";
// get all content
const allSections = await Astro.glob("../../data/veille/**/*.md");
// only keep the right locale version
const localizedSections = allSections.filter((section) => {
return section.frontmatter.lang === astroI18n.langCode;
});
---
<BaseLayout pageTitle={pageTitle}>
<section class="region flow">
<h1>{pageTitle}</h1>
<p>{t("index.veille.subtitle")}</p>
</section>
{
localizedSections.map((section) => (
<section class="flow content">
<h2>{section.frontmatter.title}</h2>
<MetaDate item={section.frontmatter} />
<section.Content />
</section>
))
}
</BaseLayout>
<style>
.content :global(ul > li) {
padding-block: var(--space-m);
}
.content :global(ul > li + li) {
margin: 0;
border-top: 1px solid var(--color-brique);
}
</style>