--- import BaseLayout from '../layouts/base.astro'; import AboutFooter from '../components/AboutFooter.astro'; import core from '../core.json'; import articles from '../articles.json'; import talks from '../talks.json'; import explorer from '../explorer.json'; import dbRepo from '../db-repo.json'; import { isPast, format } from 'date-fns'; import EventItem from '../components/EventItem.astro'; const events = core.events; const upcomingEvents = [] let eventsPast = 0 let eventsUpcoming = 0 for (const ev of events) { let future = true if (ev.date.match(/^\d{4}-\d{2}-\d{2}$/) && isPast(new Date(ev.date))) { future = false } if (future) { upcomingEvents.push(ev) eventsUpcoming++ } else { eventsPast++ } } const featuredEvents = [] for (const e of upcomingEvents) { if (featuredEvents.length > 2) { break; } if (['summit', 'meetup', 'online-summit'].includes(e.type) && e.links?.rsvp && !featuredEvents.find(ex => ex.type === e.type)) { featuredEvents.push(e) } } ---
Events
{eventsUpcoming}
Upcoming events
{ eventsPast}
Past events
{dbRepo.stars}
{dbRepo.count}
Projects
{dbRepo.contributors}
Contributors
Research
{core.projects.filter(x => x.type && x.type === "research").length} research projects →

Featured Upcoming Events

{featuredEvents.map((event) => ( ))}

Latest Articles

{articles.slice(0,4).map((entry) => (
{entry.title} {format(new Date(entry.date), 'MMMM do, yyyy')}
))}

Latest Talks

{talks.slice(0,4).map((entry) => (
))}