45 lines
1 KiB
Text
Executable file
45 lines
1 KiB
Text
Executable file
---
|
|
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 = Object.values(
|
|
import.meta.glob("../../data/veille/**/*.md", { eager: true })
|
|
);
|
|
// 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>
|