refactor(glossaire): polish contextual aside navigation
This commit is contained in:
@@ -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 />
|
||||
|
||||
Reference in New Issue
Block a user