refactor(glossaire): polish contextual aside navigation
All checks were successful
SMOKE / smoke (push) Successful in 7s
CI / build-and-anchors (push) Successful in 41s
CI / build-and-anchors (pull_request) Successful in 42s

This commit is contained in:
2026-03-12 17:42:16 +01:00
parent 0c57c4bc6d
commit 0fc0976f8a
2 changed files with 305 additions and 1 deletions

View File

@@ -1,9 +1,11 @@
---
import EditionLayout from "../../layouts/EditionLayout.astro";
import GlossaryAside from "../../components/GlossaryAside.astro";
import { getCollection, render } from "astro:content";
export async function getStaticPaths() {
const entries = await getCollection("glossaire");
return entries.map((entry) => ({
params: { slug: String(entry.id).replace(/\.(md|mdx)$/i, "") },
props: { entry },
@@ -11,6 +13,7 @@ export async function getStaticPaths() {
}
const { entry } = Astro.props;
const allEntries = await getCollection("glossaire");
const { Content } = await render(entry);
---
@@ -18,11 +21,15 @@ const { Content } = await render(entry);
title={entry.data.title}
editionLabel="Glossaire"
editionKey="glossaire"
statusLabel="référentiel"
statusLabel="Référentiel"
statusKey="referentiel"
level={1}
version={entry.data.version}
>
<Fragment slot="aside">
<GlossaryAside currentEntry={entry} allEntries={allEntries} />
</Fragment>
<h1>{entry.data.term}</h1>
<p><em>{entry.data.definitionShort}</em></p>
<Content />