From d603e93408ef9c91b7c84bc790857c10c53617eb Mon Sep 17 00:00:00 2001 From: tree Date: Sat, 2 Mar 2024 19:31:49 +0100 Subject: [PATCH] homepage: featured events --- src/contributors.json | 2 +- src/core.json | 5 ++++- src/events-ext.json | 12 +++++++++++- src/pages/index.astro | 25 ++++++++++++++++++++++--- 4 files changed, 38 insertions(+), 6 deletions(-) diff --git a/src/contributors.json b/src/contributors.json index 0745b5b..2bf7cf1 100644 --- a/src/contributors.json +++ b/src/contributors.json @@ -59,7 +59,7 @@ "received_events_url": "https://api.github.com/users/burningtree/received_events", "type": "User", "site_admin": false, - "contributions": 765 + "contributions": 766 }, { "login": "EclecticSamurai", diff --git a/src/core.json b/src/core.json index e3fd296..d86920d 100644 --- a/src/core.json +++ b/src/core.json @@ -870,7 +870,10 @@ "name-extension": "Q2", "date": "2024-06-23", "lead": "Tree", - "slots": 8 + "slots": 8, + "links": { + "rsvp": "https://lu.ma/w3pn-os24q2" + } }, { "id": "m24bcn", diff --git a/src/events-ext.json b/src/events-ext.json index 8dec3c2..3dde10f 100644 --- a/src/events-ext.json +++ b/src/events-ext.json @@ -69,6 +69,16 @@ "coverUrl": "https://images.lumacdn.com/event-covers/pq/73637b17-538e-44fa-a75a-5da505ba9d47", "guestCount": 2 }, + { + "url": "w3pn-os24q2", + "name": "W3PN ONLINE Summit Q2/2024", + "period": [ + "2024-06-23T16:00:00.000Z", + "2024-06-24T01:00:00.000Z" + ], + "coverUrl": "https://images.lumacdn.com/event-covers/ig/1f239f2c-574d-4c00-b827-c23a8c4317eb", + "guestCount": 1 + }, { "url": "w3pn-meetup-bru1", "name": "W3PN Meetup @ EthCC 7", @@ -87,7 +97,7 @@ "2024-09-07T17:00:00.000Z" ], "coverUrl": "https://images.lumacdn.com/event-covers/pq/73637b17-538e-44fa-a75a-5da505ba9d47", - "guestCount": 0 + "guestCount": 1 }, { "url": "w3pn-m24cph", diff --git a/src/pages/index.astro b/src/pages/index.astro index 206546a..3a9cc7f 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -8,9 +8,11 @@ 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) { @@ -19,12 +21,23 @@ for (const ev of events) { 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) + } +} --- @@ -80,11 +93,17 @@ for (const ev of events) {
-

Featured Events

- +

Featured Upcoming Events

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

Latest Articles