homepage: featured events

This commit is contained in:
tree🌴 2024-03-02 19:31:49 +01:00
parent 09cb5365d1
commit d603e93408
4 changed files with 38 additions and 6 deletions

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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) {
<div class="middle-pane-medium mt-10">
<!--div class="mt-10">
<h1>Our Projects</h1>
</div>
</div-->
<div class="mt-16">
<h1>Featured Events</h1>
</div-->
<h1>Featured Upcoming Events</h1>
</div>
<div class="mb-10">
{featuredEvents.map((event) => (
<EventItem item={event} />
))}
</div>
<div class="mt-16">
<h1>Latest Articles</h1>