diff --git a/src/components/GlossaryAside.astro b/src/components/GlossaryAside.astro index 38f07c8..9e2421d 100644 --- a/src/components/GlossaryAside.astro +++ b/src/components/GlossaryAside.astro @@ -1,14 +1,7 @@ --- import { - familyOf, - getContextualTheory, - getDisplayDomain, - getDisplayFamily, - getDisplayLevel, - getEntriesOfSameFamily, - getFondamentaux, - getRelationSections, - getSameFamilyTitle, + getGlossaryEntryAsideData, + getGlossaryPortalLinks, hrefOfGlossaryEntry, slugOfGlossaryEntry, } from "../lib/glossary"; @@ -19,28 +12,21 @@ const { } = Astro.props; const currentSlug = slugOfGlossaryEntry(currentEntry); -const currentFamily = familyOf(currentEntry); -const fondamentaux = getFondamentaux(allEntries); +const { + displayFamily, + displayDomain, + displayLevel, + showNoyau, + showSameFamily, + fondamentaux, + sameFamilyTitle, + sameFamilyEntries, + relationSections, + contextualTheory, +} = getGlossaryEntryAsideData(currentEntry, allEntries); -const displayFamily = getDisplayFamily(currentEntry); -const displayDomain = getDisplayDomain(currentEntry); -const displayLevel = getDisplayLevel(currentEntry); - -const sameFamilyEntries = getEntriesOfSameFamily(currentEntry, allEntries); -const sameFamilyTitle = getSameFamilyTitle(currentEntry); - -const contextualTheory = getContextualTheory(currentEntry, allEntries); - -const showNoyau = - currentFamily !== "concept-fondamental" && - fondamentaux.length > 0; - -const showSameFamily = - sameFamilyEntries.length > 0 && - currentFamily !== "concept-fondamental"; - -const relationSections = getRelationSections(currentEntry, allEntries); +const portalLinks = getGlossaryPortalLinks(); ---