--- import { getCollection } from "astro:content"; import { collectionNames } from "../config/content"; const sections = await Promise.all( collectionNames.map(async (name) => { const entries = (await getCollection(name)).sort((a, b) => a.data.title.localeCompare(b.data.title), ); const indexEntry = entries.find((entry) => entry.id === "index"); const articles = entries.filter((entry) => entry.id !== "index"); return { name, indexEntry, articles, }; }), ); ---