refactor(glossaire): extract entry relations rendering
All checks were successful
SMOKE / smoke (push) Successful in 4s
CI / build-and-anchors (push) Successful in 42s
CI / build-and-anchors (pull_request) Successful in 41s

This commit is contained in:
2026-03-25 15:30:51 +01:00
parent b2b4ec35c0
commit 4abe70e10e
2 changed files with 34 additions and 22 deletions

View File

@@ -1,13 +1,13 @@
---
import GlossaryLayout from "../../layouts/GlossaryLayout.astro";
import GlossaryAside from "../../components/GlossaryAside.astro";
import GlossaryRelationCards from "../../components/GlossaryRelationCards.astro";
import { getCollection, render } from "astro:content";
import {
getDisplayDomain,
getDisplayFamily,
getDisplayLevel,
getRelationBlocks,
hrefOfGlossaryEntry,
normalizeGlossarySlug,
} from "../../lib/glossary";
@@ -133,27 +133,7 @@ const hasScholarlyMeta =
<Content />
</div>
{relationBlocks.length > 0 && (
<section class="glossary-relations" aria-label="Relations conceptuelles">
<h2>Relations conceptuelles</h2>
<div class="glossary-relations-grid">
{relationBlocks.map((block) => (
<section class={`glossary-relations-card ${block.className}`}>
<h3>{block.title}</h3>
<ul>
{block.items.map((item) => (
<li>
<a href={hrefOfGlossaryEntry(item)}>{item.data.term}</a>
<span> — {item.data.definitionShort}</span>
</li>
))}
</ul>
</section>
))}
</div>
</section>
)}
<GlossaryRelationCards relationBlocks={relationBlocks} />
</GlossaryLayout>
<script is:inline>