diff --git a/src/components/App.astro b/src/components/App.astro index b1627cb..ed86fa7 100644 --- a/src/components/App.astro +++ b/src/components/App.astro @@ -7,6 +7,9 @@ import Background from '../components/Background'; import { getCollection } from 'astro:content'; import { getRecursivelyEntryData } from '../logic' import Modals from './Modals'; +import type { Collection } from './CollectionCard'; +import { SeriesPositionLeadingColumn, SeriesPositionCentralColumn, SeriesPositionTrailingColumn } from '../constants'; + const authors = await getCollection('authors') const numberOfAuthors = authors.length @@ -23,6 +26,8 @@ for(const seriesEntry of series){ seriesDataIndex[seriesEntry.slug]['body'] = seriesEntry.body } +const seriesValues:Collection[] = Object.values(seriesDataIndex) + const associatedPartners = await getCollection('associatedPartners') const associatedPartnersData = associatedPartners.map((entry) => { return { @@ -31,23 +36,17 @@ const associatedPartnersData = associatedPartners.map((entry) => { } }) - ---
series.position === SeriesPositionLeadingColumn)} + seriesInCentralColumn={seriesValues.filter((series) => series.position === SeriesPositionCentralColumn)} + seriesInTrailingColumn={seriesValues.filter((series) => series.position === SeriesPositionTrailingColumn)} + numberOfNotebooks={numberOfNotebooks} numberOfSeries={numberOfSeries} numberOfAuthors={numberOfAuthors} diff --git a/src/components/CollectionCard.tsx b/src/components/CollectionCard.tsx index dcb139b..b6c3db9 100644 --- a/src/components/CollectionCard.tsx +++ b/src/components/CollectionCard.tsx @@ -2,6 +2,7 @@ import React from "react" import "./CollectionCard.css" import NotebookCard, { type Notebook } from "./NotebookCard.tsx" import MarkdownSnippet from "./MarkdownSnippet.tsx" + export interface Collection { title: string excerpt: string @@ -13,6 +14,8 @@ export interface Collection { } | null | undefined + category?: string[] + position?: string notebooks: Notebook[] } diff --git a/src/components/Wall.tsx b/src/components/Wall.tsx index 0c3fdba..88ec925 100644 --- a/src/components/Wall.tsx +++ b/src/components/Wall.tsx @@ -29,9 +29,9 @@ const Wall = ({ numberOfNotebooks = 100, numberOfSeries = 2, // series = [], - seriesUnexpected = [], - seriesTutorials = [], - seriesYourData = [], + seriesInTrailingColumn = [], + seriesInLeadingColumn = [], + seriesInCentralColumn = [], enterImpressoPy, enterImpressoModels, scrollToTop = false, @@ -39,9 +39,9 @@ const Wall = ({ numberOfAuthors?: number numberOfNotebooks?: number numberOfSeries?: number - seriesUnexpected?: Collection[] - seriesTutorials?: Collection[] - seriesYourData?: Collection[] + seriesInTrailingColumn?: Collection[] + seriesInLeadingColumn?: Collection[] + seriesInCentralColumn?: Collection[] enterImpressoPy: Collection enterImpressoModels: Collection scrollToTop?: boolean @@ -118,7 +118,7 @@ const Wall = ({ - {seriesTutorials.map((collection) => ( + {seriesInLeadingColumn.map((collection) => ( - {seriesYourData.map((collection) => ( + {seriesInCentralColumn.map((collection) => ( - {seriesUnexpected.map((collection) => ( + {seriesInTrailingColumn.map((collection) => (