--- import * as config from "../config.yaml"; import core from "../core.json"; import contributors from "../contributors.json"; import SpeakerGrid from "./SpeakerGrid.astro"; import SliderTestimonial from "./SliderTestimonial.astro"; import MembersGrid from "./MembersGrid.astro"; // Accept sectionsConfig as a prop const { sectionsConfig = [ { name: "community", visible: true, order: 1 }, { name: "socialLinks", visible: true, order: 2 }, { name: "speakers", visible: true, order: 3 }, { name: "core contributors", visible: true, order: 4 }, { name: "contributors", visible: true, order: 5 }, { name: "testimonials", visible: true, order: 6 }, { name: "membersGrid", visible: true, order: 7 }, { name: "communityPartners", visible: true, order: 8 }, ], } = Astro.props; // Function to sort sections by order const sortedSections = sectionsConfig .filter((section) => section.visible) .sort((a, b) => a.order - b.order); --- { sortedSections.map((section) => (
{section.name === "community" && (

Join the Community

{config.landing.community}
)} {section.name === "socialLinks" && (
)} {section.name === "speakers" && (

Speakers

)} {section.name === "core contributors" && (

Core Contributors

)} {section.name === "contributors" && (

Contributors

{contributors.items.map((contrib) => (
))}
)} {section.name === "testimonials" && (

What People Have To Say About US

)} {section.name === "membersGrid" && (

Members

)}
)) }