on master help sign in
continued WIP events refactor
commit5e2504d6234916a47efd4d72a88819362771e852 authorGavin Atkinson <gvnatknsn@protonmail.com> dateTue 17 Aug 2021, 17:06 (5 years ago) parente66cdb4
50 files changed+364−269
components/EventPreview.js+68−49 components/PostPreview.js+3−4 components/Snippets.js+63 content/events/2017-08-11-after-hours-bootstrapping-urbit-from-the-ethereum-blockchain.md+1−1 content/events/2017-09-22-after-hours-fun-with-arvo-the-urbit-os.md+1−1 content/events/2017-10-26-after-hours-designing-robust-human-systems.md+1−1 content/events/2018-01-26-urbit-irl-20181.md+1−1 content/events/2018-02-23-urbit-irl-20182.md+1−1 content/events/2018-03-11-20183-hoon-school.md+1−1 content/events/2018-03-23-urbit-irl-20183.md+1−1 content/events/2018-04-08-20184-hoon-school.md+1−1 content/events/2018-05-25-urbit-irl-20185.md+1−1 content/events/2018-08-03-after-hours-decentralized-web-summit.md+1−1 content/events/2018-08-17-urbit-irl-20188.md+1−1 content/events/2018-09-21-urbit-irl-20189.md+1−1 content/events/2018-10-10-urbit-zcash-blockchain-week.md+1−1 content/events/2018-12-20-after-hours-its-just-a-party-man.md+1−1 content/events/2019-03-01-after-hours-ask-galen-anything.md+1−1 content/events/2019-03-08-urbit-irl-austin-tx.md+1−1 content/events/2019-04-19-urbit-irl-20194.md+1−1 content/events/2019-05-17-urbit-irl-20195.md+1−1 content/events/2019-06-21-urbit-irl-20196.md+1−1 content/events/2019-07-19-urbit-irl-20197.md+1−1 content/events/2019-08-29-urbit-austin-20198.md+1−1 content/events/2019-10-04-urbit-irl-201910.md+1−1 content/events/2019-11-15-urbit-irl-201911.md+1−1 content/events/2019-12-13-urbit-irl-201912.md+1−1 content/events/2020-01-24-urbit-irl-20201.md+1−1 content/events/2020-02-28-urbit-irl-20202.md+1−1 content/events/2020-04-03-urbit-os1-launch-party.md+1−1 content/events/2020-10-09-urbit-hosting-launch-event.md+1−1 content/events/2020-11-05-developer-call-graph-store.md+1−1 content/events/2020-11-19-developer-call-bittorrent-tracking-on-urbit.md+1−1 content/events/2020-12-10-developer-call-injecting-external-services-into-urbit.md+1−1 content/events/2021-02-04-developer-call-architectural-idea-maze.md+1−1 content/events/2021-03-04-developer-call-scaling-azimuth.md+1−1 content/events/2021-03-18-developer-call-pressure-and-protolith.md+1−1 content/events/2021-04-01-developer-call-javascript-apps-on-urbit.md+1−1 content/events/2021-04-15-developer-call-software-distribution.md+2−2 content/events/2021-04-27-bitcoin-launch.md+1−1 content/events/2021-04-29-developer-call-real-time-communications-on-urbit.md+1−1 content/events/2021-05-13-developer-call-versioned-networking.md+1−1 content/events/2021-05-27-town-hall.md+3−2 content/events/2021-07-01-developer-call-runtime-future.md+1−1 content/events/2021-07-15-developer-call-yakshaving.md+1−1 lib/lib.js−19 pages/events.js+68−74 pages/events/[slug].js+101−56 pages/index.js+12−22 scripts/event_date_upgrade.js+4−1
components/EventPreview.js+68−49
@@ -1,5 +1,6 @@
11import Link from "next/link";
22import { DateTime } from "luxon";
3+import { ShowOrHide, ReadableList, Person } from "../components/Snippets";
34import {
45 generateDisplayDate,
56 generateRealtimeDate,
@@ -7,83 +8,101 @@ import {
78 formatTime,
89} from "../lib/lib";
910
10−export default function EventPreview({ event, className, rsvp }) {
11+export default function EventPreview({ event, className, big }) {
1112 // Event tiles have a 'dark mode' used when their background images are dark and white text is needed for legibility.
12− const grayText = event.extra?.dark ? "text-midWhite" : "text-wall-500";
13− const blackText = event.extra?.dark ? "text-white" : "text-wall-600";
13+ const grayText = event?.dark ? "text-midWhite" : "text-wall-400";
14+ const blackText = event?.dark ? "text-white" : "text-wall-600";
1415
1516 const starts = generateDisplayDate(event.date);
1617 const ends = generateDisplayDate(event.ends);
1718
1819 const hasEnded = generateRealtimeDate(event.ends) > DateTime.now();
20+ const happeningNow =
21+ generateRealtimeDate(event.date) > DateTime.now() && !hasEnded;
1922
2023 return (
21− <div className={`cursor-pointer ${className}`}>
24+ <div className={`cursor-pointer aspect-w-5 aspect-h-4 ${className}`}>
2225 <div
2326 key={event.slug}
24− className={`bg-wall-100 rounded-xl h-80 bg-cover bg-center bg-no-repeat`}
25− style={{ backgroundImage: `url(${event?.image})` || "" }}
27+ className={`bg-wall-100 rounded-xl bg-cover bg-center bg-no-repeat `}
28+ style={{ backgroundImage: `url(${event.image})` || "" }}
2629 >
2730 <Link href={`/events/${event.slug}`}>
28− <div className="flex flex-col p-6 justify-between items-between h-full relative">
29− <div className="flex-grow-1 flex flex-col justify-center h-full">
31+ <div
32+ className={`flex flex-col p-6 justify-between items-between h-full relative`}
33+ >
34+ <div
35+ className={`flex-grow-1 flex ${
36+ big ? "justify-center" : ""
37+ } flex-col h-full`}
38+ >
3039 <h4 className={`${blackText}`}>{event.title}</h4>
3140 <p className={grayText}>{formatDate(starts)}</p>
3241 <p className={grayText}>
33− {formatTime(starts)} to {formatTime(ends)}
42+ {formatTime(starts)}
43+ {typeof event.ends !== "undefined"
44+ ? ` to ${formatTime(ends)}`
45+ : null}
3446 </p>
3547 </div>
48+
3649 <div className="absolute p-4 left-0 bottom-0 w-full">
37− {event.hosts
38− ? event.hosts.map((host, index) => (
39− <div className="flex">
40− {host.name ? (
41− <p className={`type-sub-bold mr-2`}>{host.name}</p>
42− ) : null}
43− {host.patp ? (
44− <p
45− className={`${
46− host.name ? grayText : ""
47− } type-sub-bold font-mono`}
48− >
49− {host.patp}
50− </p>
51− ) : null}
52− {event.hosts.length > 1 &&
53− index !== event.hosts.length - 1 ? (
54− <p className="type-sub-bold">{`,`}</p>
55− ) : null}
56− </div>
57− ))
58− : null}
59− {event.guests
60− ? event.guests.map((guest) => (
61− <div className="flex">
62− {guest.name ? (
63− <p className={`type-sub-bold mr-2`}>{guest.name}</p>
64− ) : null}
65− {guest.patp ? (
66− <p
67− className={`${
68− guest.name ? grayText : ""
69− } type-sub-bold font-mono`}
70− >
71− {guest.patp}
72− </p>
73− ) : null}
74− </div>
75− ))
76− : null}
50+ <ShowOrHide condition={event.hosts}>
51+ <p className={`type-sub-bold ${blackText}`}>
52+ {event.hosts
53+ ? event.hosts.length > 1
54+ ? "Hosts"
55+ : "Host"
56+ : null}
57+ </p>
58+ </ShowOrHide>
59+ <ShowOrHide condition={event.hosts}>
60+ <ReadableList>
61+ {event.hosts?.map((host, index) => (
62+ <Person person={host} />
63+ ))}
64+ </ReadableList>
65+ </ShowOrHide>
66+ <ShowOrHide condition={event.guests}>
67+ <p className={`type-sub-bold pt-2 ${blackText}`}>
68+ {event.guests
69+ ? event.guests.length > 1
70+ ? "With guests"
71+ : "With guest"
72+ : null}
73+ </p>
74+ </ShowOrHide>
75+ <ShowOrHide condition={event.guests}>
76+ <ReadableList>
77+ {event.guests?.map((guest, index) => (
78+ <Person person={guest} />
79+ ))}
80+ </ReadableList>
81+ </ShowOrHide>
7782 </div>
83+
7884 {hasEnded && event.registration_url ? (
7985 <div className="absolute right-0 bottom-0 p-4">
8086 <a
8187 className="button-sm bg-green-400 text-white"
8288 href={event.registration_url}
89+ onClick={(e) => e.stopPropagation()}
90+ target="_blank"
8391 >
8492 RSVP
8593 </a>
8694 </div>
95+ ) : event.youtube ? (
96+ <div className="absolute right-0 bottom-0 p-4">
97+ <a
98+ className="button-sm bg-wall-600 text-white"
99+ href={`https://www.youtube.com/watch?v=${event.youtube}`}
100+ onClick={(e) => e.stopPropagation()}
101+ target="_blank"
102+ >
103+ ▶ Watch
104+ </a>
105+ </div>
87106 ) : null}
88107 </div>
89108 </Link>
components/PostPreview.js+3−4
@@ -1,9 +1,10 @@
11import Link from "next/link";
22import BackgroundImage from "./BackgroundImage";
3−import { formatDate } from "../lib/lib";
3+import { formatDate, generateDisplayDate } from "../lib/lib";
44
55export default function PostPreview(props) {
66 const section = props?.section ? props.section : "blog";
7+ const date = generateDisplayDate(props.post.date);
78 return (
89 <div className={`cursor-pointer ${props.className}`}>
910 {props.title ? <h3 className="mb-2">{props.title}</h3> : null}
@@ -31,9 +32,7 @@ export default function PostPreview(props) {
3132 </div>
3233 ) : null}
3334 </div>
34− <div className="text-wall-500 type-sub mt-1">
35− {formatDate(new Date(props.post.date))}
36− </div>
35+ <div className="text-wall-500 type-sub mt-1">{formatDate(date)}</div>
3736 </div>
3837 </Link>
3938 </div>
components/Snippets.jsnew file+63
@@ -0,0 +1,63 @@
1+export function Name({ children, className }) {
2+ return (
3+ <b className={`type-sub font-normal ${className || ""}`}>{children}</b>
4+ );
5+}
6+
7+export function Patp({ children, className }) {
8+ return (
9+ <code className={`type-sub opacity-50 font-mono ${className || ""}`}>
10+ {children}
11+ </code>
12+ );
13+}
14+
15+// Used to render a human name alongside their @p
16+export function Person({ person, nameClassNames, patpClassNames, className }) {
17+ return (
18+ <>
19+ {person.patp && person.name ? (
20+ <>
21+ <Name className={nameClassNames}>{person.name}</Name>{" "}
22+ <Patp className={patpClassNames}>{person.patp}</Patp>
23+ </>
24+ ) : person.patp ? (
25+ <Patp className={patpClassNames}>{person.patp}</Patp>
26+ ) : person.name ? (
27+ <Name className={nameClassNames}>{person.name}</Name>
28+ ) : null}
29+ </>
30+ );
31+}
32+
33+// This goes inside a <p/> tag
34+export function ReadableList({ children, serial = ",", conjunction = "and" }) {
35+ return (
36+ <>
37+ {children.map((Child, index) => {
38+ if (index < children.length - 2) {
39+ return (
40+ <>
41+ {Child}
42+ {serial}
43+ </>
44+ );
45+ } else if (index < children.length - 1) {
46+ return (
47+ <>
48+ {Child} {conjunction}{" "}
49+ </>
50+ );
51+ }
52+ return <>{Child}</>;
53+ })}
54+ </>
55+ );
56+}
57+
58+export function ShowOrHide({ children, condition }) {
59+ if (condition) {
60+ return children;
61+ }
62+ return null;
63+}
content/events/2017-08-11-after-hours-bootstrapping-urbit-from-the-ethereum-blockchain.md+1−1
@@ -2,12 +2,12 @@
22title = "After hours: Bootstrapping Urbit from the Ethereum blockchain"
33ends = "2017-08-12T07:00:00.000-07:00"
44pinned = false
5−contributors = ""
65location = "Urbit Office"
76image = ""
87registration_url = "https://www.meetup.com/urbit-sf/events/242295411/"
98description = "This time we'll be opening up the office, opening up a few cold ones, and talking about Urbit + Ethereum."
109date = "2017-08-12T04:00:00.000-07:00"
10+guests = ""
1111
1212[[hosts]]
1313name = "Urbit"
content/events/2017-09-22-after-hours-fun-with-arvo-the-urbit-os.md+1−1
@@ -1,12 +1,12 @@
11+++
22title = "After hours: Fun with %arvo (the Urbit OS)"
33ends = "2017-09-23T07:00:00.000-07:00"
4−contributors = ""
54location = "Urbit Office"
65image = ""
76registration_url = "https://www.meetup.com/urbit-sf/events/243213975/"
87description = "Same as usual: cold drinks in the backyard with the hoons.  Come meet other people crazy enough to want to replace the internet."
98date = "2017-09-23T04:00:00.000-07:00"
9+guests = ""
1010
1111[[hosts]]
1212name = "Urbit"
content/events/2017-10-26-after-hours-designing-robust-human-systems.md+1−1
@@ -1,12 +1,12 @@
11+++
22title = "After hours: Designing robust human systems"
33ends = "2017-10-27T07:00:00.000-07:00"
4−contributors = ""
54location = "Urbit Office"
65image = ""
76registration_url = "https://www.meetup.com/urbit-sf/events/244316080/"
87description = "The office will be open and the beer will be cold.  Come hang out and talk about all things Urbit and Urbit related.  Cryptoeconomics, protocols, architecture, Japanese poetry, ancient aqueducts.  You get the idea."
98date = "2017-10-27T04:00:00.000-07:00"
9+guests = ""
1010
1111[[hosts]]
1212name = "Urbit"
content/events/2018-01-26-urbit-irl-20181.md+1−1
@@ -1,12 +1,12 @@
11+++
22title = "Urbit IRL ~2018.1"
33ends = "2018-01-27T06:00:00.000-08:00"
4−contributors = ""
54location = "Urbit office"
65image = ""
76registration_url = "https://www.meetup.com/urbit-sf/events/246972285/"
87description = "Happy New Year!"
98date = "2018-01-27T04:00:00.000-08:00"
9+guests = ""
1010
1111[[hosts]]
1212name = "Urbit"
content/events/2018-02-23-urbit-irl-20182.md+1−1
@@ -1,12 +1,12 @@
11+++
22title = "Urbit IRL ~2018.2"
33ends = "2018-02-24T07:00:00.000-08:00"
4−contributors = ""
54location = "Urbit office"
65image = ""
76registration_url = "https://www.meetup.com/urbit-sf/events/247797527/"
87description = "Turns out that just getting Urbit fans in one room is pretty fun — so come hang out and have something to drink."
98date = "2018-02-24T04:00:00.000-08:00"
9+guests = ""
1010
1111[[hosts]]
1212name = "Urbit"
content/events/2018-03-11-20183-hoon-school.md+1−1
@@ -1,12 +1,12 @@
11+++
22title = "~2018.3 Hoon School"
33ends = "2018-03-12T07:00:00.000-07:00"
4−contributors = ""
54location = "Urbit office"
65image = ""
76registration_url = "https://www.meetup.com/urbit-sf/events/248416276/"
87description = "Come, bring your laptop, and we'll get you started building things in Urbit's language — Hoon."
98date = "2018-03-12T04:00:00.000-07:00"
9+guests = ""
1010
1111[[hosts]]
1212name = "Urbit"
content/events/2018-03-23-urbit-irl-20183.md+1−1
@@ -1,12 +1,12 @@
11+++
22title = "Urbit IRL ~2018.3"
33ends = "2018-03-24T07:00:00.000-07:00"
4−contributors = ""
54location = "Urbit office"
65image = ""
76registration_url = "https://www.meetup.com/urbit-sf/events/248852261/"
87description = "Turns out that just getting Urbit fans in one room is pretty fun — so come hang out and have a beer."
98date = "2018-03-24T04:00:00.000-07:00"
9+guests = ""
1010
1111[[hosts]]
1212name = "Urbit"
content/events/2018-04-08-20184-hoon-school.md+1−1
@@ -1,12 +1,12 @@
11+++
22title = "~2018.4 Hoon School"
33ends = "2018-04-09T00:00:00.000-07:00"
4−contributors = ""
54location = "Urbit office"
65image = ""
76registration_url = "https://www.meetup.com/urbit-sf/events/249019207/"
87description = "Come, bring your laptop, and we'll get you started building things in Urbit's language — Hoon."
98date = "2018-04-08T21:00:00.000-07:00"
9+guests = ""
1010
1111[[hosts]]
1212name = "Urbit"
content/events/2018-05-25-urbit-irl-20185.md+1−1
@@ -1,12 +1,12 @@
11+++
22title = "Urbit IRL ~2018.5"
33ends = "2018-05-26T07:00:00.000-07:00"
4−contributors = ""
54location = "Urbit office"
65image = ""
76registration_url = "https://www.meetup.com/urbit-sf/events/250889557/"
87description = "Turns out that just getting Urbit fans in one room is pretty fun — so come hang out and have a beer (or wine)."
98date = "2018-05-26T04:00:00.000-07:00"
9+guests = ""
1010
1111[[hosts]]
1212name = "Urbit"
content/events/2018-08-03-after-hours-decentralized-web-summit.md+1−1
@@ -1,12 +1,12 @@
11+++
22title = "After hours 'decentralized web summit'"
33ends = "2018-08-04T03:00:00.000-07:00"
4−contributors = ""
54location = "Orbit Room"
65image = ""
76registration_url = "https://www.meetup.com/urbit-sf/events/253423219/"
87description = "We’re hosting a last minute happy hour for our friends in town for the Decentralized Web Summit. All are welcome to join us tomorrow, Friday, August 3 at the Orbit Room from 5-7PM."
98date = "2018-08-04T01:00:00.000-07:00"
9+guests = ""
1010
1111[[hosts]]
1212name = "Urbit"
content/events/2018-08-17-urbit-irl-20188.md+1−1
@@ -1,12 +1,12 @@
11+++
22title = "Urbit IRL ~2018.8"
33ends = "2018-08-18T06:00:00.000-07:00"
4−contributors = ""
54location = "Urbit Office"
65image = ""
76registration_url = "https://www.meetup.com/urbit-sf/events/253292678/"
87description = "UPDATE: Hey Everyone! Due to a conflict, we are rescheduling our gathering to the following Friday, August 17."
98date = "2018-08-18T04:00:00.000-07:00"
9+guests = ""
1010
1111[[hosts]]
1212name = "Urbit"
content/events/2018-09-21-urbit-irl-20189.md+1−1
@@ -1,12 +1,12 @@
11+++
22title = "Urbit IRL ~2018.9"
33ends = "2018-09-22T07:00:00.000-07:00"
4−contributors = ""
54location = "Urbit Office"
65image = ""
76registration_url = "https://www.meetup.com/urbit-sf/events/254602025/"
87description = "Turns out that just getting Urbit fans in one room is pretty fun — so come hang out and have a beer (or wine)."
98date = "2018-09-22T04:00:00.000-07:00"
9+guests = ""
1010
1111[[hosts]]
1212name = "Urbit"
content/events/2018-10-10-urbit-zcash-blockchain-week.md+1−1
@@ -1,12 +1,12 @@
11+++
22title = "Urbit + Zcash: 'Blockchain Week'"
33ends = "2018-10-11T06:00:00.000-07:00"
4−contributors = ""
54location = "Urbit Office"
65image = ""
76registration_url = "https://www.meetup.com/urbit-sf/events/255001807/"
87description = "We're all full and looking forward to seeing you tonight. After you check-in at the front door please come up to floor 2, room 222."
98date = "2018-10-11T03:00:00.000-07:00"
9+guests = ""
1010
1111[[hosts]]
1212name = "Urbit"
content/events/2018-12-20-after-hours-its-just-a-party-man.md+1−1
@@ -1,12 +1,12 @@
11+++
22title = "After hours: It's just a party, man"
33ends = "2018-12-21T06:00:00.000-08:00"
4−contributors = ""
54location = "Urbit Office"
65image = ""
76registration_url = "https://www.meetup.com/urbit-sf/events/256732938/"
87description = "We had a busy and productive 2018. This time around, we're just going to play music and relax."
98date = "2018-12-21T03:00:00.000-08:00"
9+guests = ""
1010
1111[[hosts]]
1212name = "Urbit"
content/events/2019-03-01-after-hours-ask-galen-anything.md+1−1
@@ -1,12 +1,12 @@
11+++
22title = "After hours: Ask Galen Anything"
33ends = "2019-03-02T06:30:00.000-08:00"
4−contributors = ""
54location = "Urbit Office"
65image = ""
76registration_url = "https://www.meetup.com/urbit-sf/events/259144802/"
87description = "We thought we'd try something new this month. Come hang out and ask Galen questions about Azimuth, Arvo, or any part of Urbit."
98date = "2019-03-02T03:30:00.000-08:00"
9+guests = ""
1010
1111[[hosts]]
1212name = "Urbit"
content/events/2019-03-08-urbit-irl-austin-tx.md+1−1
@@ -1,12 +1,12 @@
11+++
22title = "Urbit IRL: Austin, TX"
33ends = "2019-03-09T03:00:00.000-08:00"
4−contributors = ""
54location = "Garage"
65image = ""
76registration_url = "https://www.meetup.com/urbit-sf/events/259307805/"
87description = "We're coming to Austin, TX! It turns out that just getting Urbit fans in one room is pretty fun — so come hang out and have a drink on us. Feel free to bring friends and come early for Urbit shirts."
98date = "2019-03-09T01:00:00.000-08:00"
9+guests = ""
1010
1111[[hosts]]
1212name = "Urbit"
content/events/2019-04-19-urbit-irl-20194.md+1−1
@@ -1,12 +1,12 @@
11+++
22title = "Urbit IRL ~2019.4"
33ends = "2019-04-20T06:00:00.000-07:00"
4−contributors = ""
54location = "Urbit Office"
65image = ""
76registration_url = "https://www.meetup.com/urbit-sf/events/260326318/"
87description = "Turns out that just getting Urbit fans in one room is pretty fun — so come hang out and have a beer (or wine)."
98date = "2019-04-20T03:00:00.000-07:00"
9+guests = ""
1010
1111[[hosts]]
1212name = "Urbit"
content/events/2019-05-17-urbit-irl-20195.md+1−1
@@ -1,12 +1,12 @@
11+++
22title = "Urbit IRL ~2019.5"
33ends = "2019-05-18T06:00:00.000-07:00"
4−contributors = ""
54location = "Urbit Office"
65image = ""
76registration_url = "https://www.meetup.com/urbit-sf/events/261110620/"
87description = "Turns out that just getting Urbit fans in one room is pretty fun — so come hang out and have a beer, or wine."
98date = "2019-05-18T03:00:00.000-07:00"
9+guests = ""
1010
1111[[hosts]]
1212name = "Urbit"
content/events/2019-06-21-urbit-irl-20196.md+1−1
@@ -1,12 +1,12 @@
11+++
22title = "Urbit IRL ~2019.6"
33ends = "2019-06-22T06:00:00.000-07:00"
4−contributors = ""
54location = "Urbit Office"
65image = ""
76registration_url = "https://www.meetup.com/urbit-sf/events/262079477/"
87description = "Turns out that just getting Urbit fans in one room is pretty fun — so come hang out and have some beer and pizza."
98date = "2019-06-22T03:00:00.000-07:00"
9+guests = ""
1010
1111[[hosts]]
1212name = "Urbit"
content/events/2019-07-19-urbit-irl-20197.md+1−1
@@ -1,12 +1,12 @@
11+++
22title = "Urbit IRL ~2019.7"
33ends = "2019-07-20T06:00:00.000-07:00"
4−contributors = ""
54location = "Urbit Office"
65image = "https://secure.meetupstatic.com/photos/event/e/0/5/b/600_482817435.jpeg"
76registration_url = "https://www.meetup.com/urbit-sf/events/262858100/"
87description = "Turns out that just getting Urbit fans in one room is pretty fun — so come hang out and chat with old and new friends over a beer."
98date = "2019-07-20T03:00:00.000-07:00"
9+guests = ""
1010
1111[[hosts]]
1212name = "Urbit"
content/events/2019-08-29-urbit-austin-20198.md+1−1
@@ -1,12 +1,12 @@
11+++
22title = "Urbit Austin ~2019.8"
33ends = "2019-08-30T04:00:00.000-07:00"
4−contributors = ""
54location = "Garage"
65image = "https://secure.meetupstatic.com/photos/event/a/8/d/4/600_483643220.jpeg"
76registration_url = "https://www.meetup.com/urbit-sf/events/263655974/"
87description = "Thanks to our friends over at Garage for offering to host another meetup in Austin, Texas."
98date = "2019-08-30T02:00:00.000-07:00"
9+guests = ""
1010
1111[[hosts]]
1212name = "Urbit"
content/events/2019-10-04-urbit-irl-201910.md+1−1
@@ -1,12 +1,12 @@
11+++
22title = "Urbit IRL ~2019.10"
33ends = "2019-10-05T06:00:00.000-07:00"
4−contributors = ""
54location = "Urbit Office"
65image = "https://secure.meetupstatic.com/photos/event/e/1/c/5/600_485217797.jpeg"
76registration_url = "https://www.meetup.com/urbit-sf/events/265165676/"
87description = "Lately, Urbit has been having dangerous amounts of fun online. So we got thinking, 'Wouldn't it be smart to try having fun offline as well?' Thus, we invented something totally new: an offline chatroom."
98date = "2019-10-05T03:00:00.000-07:00"
9+guests = ""
1010
1111[[hosts]]
1212name = "Urbit"
content/events/2019-11-15-urbit-irl-201911.md+1−1
@@ -1,12 +1,12 @@
11+++
22title = "Urbit IRL ~2019.11"
33ends = "2019-11-16T06:00:00.000-08:00"
4−contributors = ""
54location = "Urbit Office"
65image = "https://secure.meetupstatic.com/photos/event/4/c/e/6/600_486379686.jpeg"
76registration_url = "https://www.meetup.com/urbit-sf/events/266146513/"
87description = "Lately, Urbit has been having dangerous amounts of fun online. So we got thinking, 'Wouldn't it be smart to try having fun offline as well?' Thus, we invented something totally new: an offline chatroom."
98date = "2019-11-16T03:00:00.000-08:00"
9+guests = ""
1010
1111[[hosts]]
1212name = "Urbit"
content/events/2019-12-13-urbit-irl-201912.md+1−1
@@ -1,12 +1,12 @@
11+++
22title = "Urbit IRL ~2019.12"
33ends = "2019-12-14T05:00:00.000-08:00"
4−contributors = ""
54location = "Urbit Office"
65image = "https://secure.meetupstatic.com/photos/event/6/a/8/8/600_487107272.jpeg"
76registration_url = "https://www.meetup.com/urbit-sf/events/266904108/"
87description = "Come celebrate, friends! Urbit has had quite the decade, transforming from an intercepted interstellar transmission to a functional operating system, which also functions."
98date = "2019-12-14T03:00:00.000-08:00"
9+guests = ""
1010
1111[[hosts]]
1212name = "Urbit"
content/events/2020-01-24-urbit-irl-20201.md+1−1
@@ -1,12 +1,12 @@
11+++
22title = "Urbit IRL ~2020.1"
33ends = "2020-01-25T06:00:00.000-08:00"
4−contributors = ""
54location = "Urbit Office"
65image = "https://secure.meetupstatic.com/photos/event/2/1/7/6/600_487988566.jpeg"
76registration_url = "https://www.meetup.com/urbit-sf/events/267753862/"
87description = "Neo-Urbit arrives from the future."
98date = "2020-01-25T03:00:00.000-08:00"
9+guests = ""
1010
1111[[hosts]]
1212name = "Urbit"
content/events/2020-02-28-urbit-irl-20202.md+1−1
@@ -1,12 +1,12 @@
11+++
22title = "Urbit IRL ~2020.2"
33ends = "2020-02-29T06:00:00.000-08:00"
4−contributors = ""
54location = "Urbit Office"
65image = "https://secure.meetupstatic.com/photos/event/8/5/e/b/600_488794283.jpeg"
76registration_url = "https://www.meetup.com/urbit-sf/events/268519069/"
87description = "Urbit is a wilderness right now. A vast continent of possibility. We're gonna head out there and hack around. Join us."
98date = "2020-02-29T03:00:00.000-08:00"
9+guests = ""
1010
1111[[hosts]]
1212name = "Urbit"
content/events/2020-04-03-urbit-os1-launch-party.md+1−1
@@ -1,13 +1,13 @@
11+++
22title = "Urbit OS1 Launch Party"
33ends = "2020-04-04T06:00:00.000-07:00"
4−contributors = ""
54location = "Online event"
65image = "https://secure.meetupstatic.com/photos/event/1/f/8/b/600_489548075.jpeg"
76registration_url = "https://www.meetup.com/urbit-sf/events/268519156/"
87youtube = "71ViyftPkGk"
98description = "Join us as we launch Urbit OS1!"
109date = "2020-04-04T03:00:00.000-07:00"
10+guests = ""
1111
1212[[hosts]]
1313name = "Urbit"
content/events/2020-10-09-urbit-hosting-launch-event.md+1−1
@@ -1,13 +1,13 @@
11+++
22title = "Urbit Hosting Launch Event"
33ends = "2020-10-10T03:00:00.000-07:00"
4−contributors = ""
54location = "Online event"
65image = "https://secure.meetupstatic.com/photos/event/8/600_492480008.jpeg"
76registration_url = "https://www.meetup.com/urbit-sf/events/273439025/"
87youtube = "w3qKe_WZr50"
98description = ""
109date = "2020-10-10T01:00:00.000-07:00"
10+guests = ""
1111
1212[[hosts]]
1313name = "Urbit"
content/events/2020-11-05-developer-call-graph-store.md+1−1
@@ -1,13 +1,13 @@
11+++
22title = "Developer Call: Graph Store"
33ends = "2020-11-05T18:30:00.000-08:00"
4−contributors = ""
54location = "Online event"
65image = ""
76registration_url = "https://www.meetup.com/urbit-sf/events/274279522/"
87youtube = "E4DFuAZQ32Y"
98description = ""
109date = "2020-11-05T17:00:00.000-08:00"
10+guests = ""
1111
1212[[hosts]]
1313name = "Lane R."
content/events/2020-11-19-developer-call-bittorrent-tracking-on-urbit.md+1−1
@@ -1,13 +1,13 @@
11+++
22title = "Developer Call: BitTorrent tracking on Urbit"
33ends = "2020-11-19T18:30:00.000-08:00"
4−contributors = ""
54location = "Online event"
65image = ""
76registration_url = "https://www.meetup.com/urbit-sf/events/274650693/"
87youtube = "cvx2UV6TJ5I"
98description = "Developer calls are focused on the technologies that underpin Urbit, from the top of the stack to the very bottom. They’re an opportunity for the people developing and contributing to Urbit to share their knowledge and expertise, including things that typically don’t make it into the docs, such as how and why Urbit works the way it does."
109date = "2020-11-19T17:00:00.000-08:00"
10+guests = ""
1111
1212[[hosts]]
1313name = "Lane R."
content/events/2020-12-10-developer-call-injecting-external-services-into-urbit.md+1−1
@@ -1,13 +1,13 @@
11+++
22title = "Developer Call: Injecting External Services into Urbit"
33ends = "2020-12-10T18:30:00.000-08:00"
4−contributors = ""
54location = "Online event"
65image = ""
76registration_url = "https://www.meetup.com/urbit-sf/events/275051926/"
87youtube = "LaWNHMmxQag"
98description = ""
109date = "2020-12-10T17:00:00.000-08:00"
10+guests = ""
1111
1212[[hosts]]
1313name = "Lane R."
content/events/2021-02-04-developer-call-architectural-idea-maze.md+1−1
@@ -1,12 +1,12 @@
11+++
22title = "Developer Call: Architectural Idea Maze"
33ends = "2021-02-04T18:30:00.000-08:00"
4−contributors = ""
54location = "Online event"
65image = ""
76registration_url = "https://www.meetup.com/urbit-sf/events/275992798/"
87description = ""
98date = "2021-02-04T17:00:00.000-08:00"
9+guests = ""
1010
1111[[hosts]]
1212name = "Lane R."
content/events/2021-03-04-developer-call-scaling-azimuth.md+1−1
@@ -1,13 +1,13 @@
11+++
22title = "Developer Call: Scaling Azimuth"
33ends = "2021-03-04T18:30:00.000-08:00"
4−contributors = ""
54location = "Online event"
65image = ""
76registration_url = "https://www.meetup.com/urbit-sf/events/276692816/"
87youtube = "CKuHXrdkIw0"
98description = ""
109date = "2021-03-04T17:00:00.000-08:00"
10+guests = ""
1111
1212[[hosts]]
1313name = "Urbit"
content/events/2021-03-18-developer-call-pressure-and-protolith.md+1−1
@@ -12,7 +12,7 @@ date = "2021-03-18T17:00:00.000-07:00"
1212name = "Josh Lehman"
1313patp = "~wolref-podlex)"
1414
15−[[contributors]]
15+[[guests]]
1616name = "Matilde Park"
1717patp = "~haddef-sigwen"
1818+++
content/events/2021-04-01-developer-call-javascript-apps-on-urbit.md+1−1
@@ -12,7 +12,7 @@ date = "2021-04-01T17:00:00.000-07:00"
1212name = "Mike Osborne"
1313patp = "~taller-ravnut"
1414
15−[[contributors]]
15+[[guests]]
1616name = "Tyler Brown Cifu Shuster"
1717patp = "~radbur-sivmus"
1818+++
content/events/2021-04-15-developer-call-software-distribution.md+2−2
@@ -12,11 +12,11 @@ date = "2021-04-15T17:00:00.000-07:00"
1212name = "Josh Lehman"
1313patp = "~wolref-podlex"
1414
15−[[contributors]]
15+[[guests]]
1616name = "Raghu"
1717patp = "~sovmep-ripsum"
1818
19−[[contributors]]
19+[[guests]]
2020name = " Philip Monk"
2121patp = "~wicdev-wisryt"
2222+++
content/events/2021-04-27-bitcoin-launch.md+1−1
@@ -11,7 +11,7 @@ date = "2021-04-27T20:00:00.000-07:00"
1111[[hosts]]
1212name = "Urbit Foundation"
1313
14−[[contributors]]
14+[[guests]]
1515name = "Marty Bent"
1616+++
1717
content/events/2021-04-29-developer-call-real-time-communications-on-urbit.md+1−1
@@ -12,7 +12,7 @@ date = "2021-04-29T17:00:00.000-07:00"
1212name = "Josh Lehman"
1313patp = "~wolref-podlex"
1414
15−[[contributors]]
15+[[guests]]
1616name = "Edward Amsden"
1717patp = "~ritpub-sipsyl"
1818+++
content/events/2021-05-13-developer-call-versioned-networking.md+1−1
@@ -12,7 +12,7 @@ date = "2021-05-14T00:00:00.000-07:00"
1212name = "Josh Lehman"
1313patp = "~wolref-podlex"
1414
15−[[contributors]]
15+[[guests]]
1616name = "Liam Fitzgerald"
1717patp = "~hastuc-dibtux"
1818+++
content/events/2021-05-27-town-hall.md+3−2
@@ -7,16 +7,17 @@ registration_url = "https://www.meetup.com/urbit-sf/events/278188361/"
77description = "A virtual mini-conference for the Urbit community featuring a special keynote talk from our friend Justin Murphy."
88youtube = "8YSwt0vDPj0"
99date = "2021-05-27T20:00:00.000-07:00"
10+dark = true
1011
1112[[hosts]]
1213name = "Josh Lehman"
1314patp = "~wolref-podlex"
1415
15−[[contributors]]
16+[[guests]]
1617name = "Hunter Miller"
1718patp = "~nocsyx-lassul"
1819
19−[[contributors]]
20+[[guests]]
2021name = "Justin Murphy"
2122patp = "~hatryx-lastud"
2223+++
content/events/2021-07-01-developer-call-runtime-future.md+1−1
@@ -12,7 +12,7 @@ date = "2021-07-01T17:00:00.000-07:00"
1212name = "Ted Blackman"
1313patp = "~rovnys-ricfer"
1414
15−[[contributors]]
15+[[guests]]
1616name = "Joe Bryan"
1717patp = "~master-morzod"
1818+++
content/events/2021-07-15-developer-call-yakshaving.md+1−1
@@ -12,7 +12,7 @@ date = "2021-07-15T17:00:00.000-07:00"
1212name = "Josh Lehman"
1313patp = "~wolref-podlex"
1414
15−[[contributors]]
15+[[guests]]
1616name = "Jake Miller"
1717patp = "~littel-wolfur"
1818+++
lib/lib.js−19
@@ -129,25 +129,6 @@ export function getPreviousPost(slug, fields = [], key, sort = "date") {
129129 return resultPost;
130130}
131131
132−// export function formatDate(d) {
133−// const wk = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
134−// const mn = [
135−// "January",
136−// "February",
137−// "March",
138−// "April",
139−// "May",
140−// "June",
141−// "July",
142−// "August",
143−// "September",
144−// "October",
145−// "November",
146−// "December",
147−// ];
148−// return mn[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear();
149−// }
150−
151132export function formatDateWithTime(d) {
152133 const date = DateTime.fromISO(d, {
153134 setZone: true,
pages/events.js+68−74
@@ -1,74 +1,47 @@
11import Head from "next/head";
2−import Meta from "../components/Meta";
32import Link from "next/link";
3+import { DateTime } from "luxon";
4+
5+import Meta from "../components/Meta";
46import Container from "../components/Container";
57import Footer from "../components/Footer";
68import Header from "../components/Header";
79import SingleColumn from "../components/SingleColumn";
810import Section from "../components/Section";
9−import { getAllPosts, formatDate } from "../lib/lib";
11+import EventPreview from "../components/EventPreview";
12+import { ShowOrHide } from "../components/Snippets";
1013import { contact } from "../lib/constants";
14+import {
15+ getAllPosts,
16+ generateDisplayDate,
17+ generateRealtimeDate,
18+ formatDate,
19+ formatTime,
20+} from "../lib/lib";
1121
12−export function EventCard({ event, dir, className }) {
13− // Event tiles have a 'dark mode' used when their background images are dark and white text is needed for legibility.
14− const grayText = event.extra?.dark ? "text-midWhite" : "text-wall-500";
15− const blackText = event.extra?.dark ? "text-white" : "text-wall-600";
16−
17− return (
18− <div
19− key={event.slug}
20− className={`mb-24 cursor-pointer bg-wall-100 rounded-xl h-96 bg-cover bg-center bg-no-repeat ${className}`}
21− style={{
22− backgroundImage:
23− `${
24− event.extra?.overlay
25− ? "linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)),"
26− : ""
27− }url(${event.extra?.image})` || "",
28− }}
29− >
30− <Link href={`${dir ? dir : "/events/"}${event.slug}`}>
31− <div className="flex flex-col p-8 justify-between items-between h-full relative">
32− <div className="flex-grow-1 flex flex-col justify-center h-full">
33− <h3 className={`mb-4 ${blackText}`}>{event.title}</h3>
34− <h4 className={grayText}>{event?.type}</h4>
35− </div>
36− <div className="absolute left-8 bottom-8 w-full">
37− <p className={grayText}>{event.extra.host}</p>
38− <p className={grayText}>{event.extra.guests}</p>
39− </div>
40− {event.extra.youtube ? (
41− <a
42− onClick={(e) => e.stopPropagation()}
43− className="absolute w-16 h-16 right-8 bottom-8 bg-white flex items-center justify-center rounded-full"
44− target="_blank"
45− href={`https://www.youtube.com/watch?v=${event.extra.youtube}`}
46− >
47− <svg
48− width="48"
49− height="48"
50− viewBox="0 0 16 16"
51− fill="none"
52− xmlns="http://www.w3.org/2000/svg"
53− >
54− <path
55− d="M11.25 7.56699C11.5833 7.75944 11.5833 8.24056 11.25 8.43301L6.75 11.0311C6.41667 11.2235 6 10.983 6 10.5981L6 5.40192C6 5.01702 6.41667 4.77646 6.75 4.96891L11.25 7.56699Z"
56− fill="black"
57− />
58− </svg>
59− </a>
60− ) : null}
61− </div>
62− </Link>
63− </div>
64− );
65−}
66−
67−export default function Events({ pastEvents, comingSoon, search }) {
22+export default function Events({ posts, search }) {
6823 const post = {
6924 title: "Events",
7025 description: "In-person, remote, and recorded events about Urbit.",
7126 };
27+
28+ const now = DateTime.now();
29+
30+ const pastEvents = posts.filter((post) => {
31+ const ends = generateRealtimeDate(post.ends);
32+ return ends < now;
33+ });
34+
35+ const futureEvents = posts.filter((post) => {
36+ const starts = generateRealtimeDate(post.date);
37+ return starts > now;
38+ });
39+ const happeningNow = posts.filter((post) => {
40+ const starts = generateRealtimeDate(post.date);
41+ const ends = generateRealtimeDate(post.ends);
42+ return starts > DateTime.now() && ends < now;
43+ });
44+
7245 return (
7346 <Container>
7447 <Head>
@@ -77,7 +50,7 @@ export default function Events({ pastEvents, comingSoon, search }) {
7750 </Head>
7851 <SingleColumn>
7952 <Header search={search} />
80− <Section narrow>
53+ <Section short narrow>
8154 <div className="measure">
8255 <h1 className="pb-16">Events</h1>
8356 <p className="pb-6">
@@ -91,21 +64,32 @@ export default function Events({ pastEvents, comingSoon, search }) {
9164 </Section>
9265
9366 <Section narrow>
94− {comingSoon.length > 0 ? (
67+ {happeningNow.length > 0 ? (
68+ <>
69+ <div className="mb-8 mt-16 table">
70+ <h3 className="text-green-400">Happening Now</h3>
71+ </div>
72+ {happeningNow.map((post) => {
73+ return <EventPreview big event={post} />;
74+ })}
75+ </>
76+ ) : null}
77+ {futureEvents.length > 0 ? (
9578 <>
96− <div className="mb-8 table">
97− <h3 className="text-wall-500">Coming Soon</h3>
79+ <div className="mb-8 mt-16 table">
80+ <h3 className="text-green-400">Coming Soon</h3>
9881 </div>
99− {comingSoon.map((post) => {
100− return <EventCard event={post} />;
82+ {futureEvents.map((post) => {
83+ return <EventPreview big event={post} />;
10184 })}
10285 </>
10386 ) : null}
104− <div className="mb-8 table">
87+ <div className="mb-8 mt-16 table">
10588 <h3 className="text-wall-500">Past Events</h3>
10689 </div>
90+
10791 {pastEvents.map((post) => {
108− return <EventCard event={post} />;
92+ return <EventPreview big event={post} className="mb-8" />;
10993 })}
11094 </Section>
11195 </SingleColumn>
@@ -115,15 +99,25 @@ export default function Events({ pastEvents, comingSoon, search }) {
11599}
116100
117101export async function getStaticProps() {
118− const posts = getAllPosts(["title", "slug", "date", "extra"], "events");
119−
120− // NB Gavin: This logic can change based on how we want to separate past vs current events
121− // const pastEvents = posts.filter((post) => !post.extra.pinned);
122− // const comingSoon = posts.filter((post) => post.extra.pinned);
123− const pastEvents = posts;
124− const comingSoon = posts;
102+ const posts = getAllPosts(
103+ [
104+ "title",
105+ "ends",
106+ "location",
107+ "image",
108+ "registration_url",
109+ "youtube",
110+ "description",
111+ "date",
112+ "hosts",
113+ "guests",
114+ "dark",
115+ "slug",
116+ ],
117+ "events"
118+ );
125119
126120 return {
127− props: { pastEvents, comingSoon },
121+ props: { posts },
128122 };
129123}
pages/events/[slug].js+101−56
@@ -5,6 +5,8 @@ import {
55 getNextPost,
66 getPreviousPost,
77 formatDate,
8+ formatTime,
9+ generateDisplayDate,
810} from "../../lib/lib";
911import Head from "next/head";
1012import Meta from "../../components/Meta";
@@ -16,65 +18,72 @@ import SingleColumn from "../../components/SingleColumn";
1618import Contact from "../../components/Contact";
1719import EventPreview from "../../components/EventPreview";
1820import Section from "../../components/Section";
21+import { Person, ReadableList, ShowOrHide } from "../../components/Snippets";
1922import { decode } from "html-entities";
2023
2124export default function Event({
22− post,
23− nextPost,
24− previousPost,
25+ event,
26+ nextEvent,
27+ previousEvent,
2528 markdown,
2629 search,
2730}) {
31+ const starts = generateDisplayDate(event.date);
32+ const ends = generateDisplayDate(event.ends);
33+
2834 return (
2935 <Container>
3036 <Head>
31− <title>{post.title} • Events • urbit.org</title>
32− {Meta(post)}
37+ <title>{event.title} • Events • urbit.org</title>
38+ {Meta(event)}
3339 </Head>
3440 <SingleColumn>
3541 <Header search={search} />
3642 <Section narrow short>
37− <h1>{post.title}</h1>
38−
39− {post.extra.author ? (
40− <div className="type-ui text-wall-500 mt-4 md:mt-8 lg:mt-10">
41− {post.extra.author}
42− </div>
43− ) : null}
44− {post.extra.ship ? (
45− <div className="type-ui text-wall-500 font-mono">
46− {post.extra.ship}
47− </div>
43+ <h1>{event.title}</h1>
44+ <h3 className="mt-6">{event.description}</h3>
45+ <p className="text-wall-400 mt-6">{formatDate(starts)}</p>
46+ <p className="text-wall-400">
47+ {formatTime(starts)}
48+ <ShowOrHide
49+ condition={typeof event.ends !== "undefined"}
50+ >{` to ${formatTime(ends)}`}</ShowOrHide>
51+ </p>
52+ <h4>{`Host${event.hosts.length > 1 ? "s" : ""}`}</h4>
53+ <p>
54+ <ReadableList>
55+ {event.hosts.map((host) => (
56+ <Person person={host} />
57+ ))}
58+ </ReadableList>
59+ </p>
60+ {event.guests ? (
61+ <>
62+ <h4>{`With Guest${event.hosts.length > 1 ? "s" : ""}`}</h4>
63+ <p>
64+ <ReadableList>
65+ {event.guests.map((guest) => (
66+ <Person person={guest} />
67+ ))}
68+ </ReadableList>
69+ </p>
70+ </>
4871 ) : null}
49−
50− <div className="mt-16">
51− <p className="type-ui text-wall-500">
52− {formatDate(new Date(post.date))} {", " + post.extra.time}
53− </p>
54− {post.registration_url && post.pinned ? (
55− <a
56− className="button-sm bg-green-400 text-white flex-0 mt-4"
57− href={post.extra.registration_url}
58− >
59− RSVP
60− </a>
61− ) : null}
62− </div>
6372 </Section>
6473 <Section short wide>
65− {post.extra.youtube ? (
74+ {event.youtube ? (
6675 <iframe
6776 className="rounded-xl"
6877 width="100%"
6978 height="640px"
70− src={`https://www.youtube.com/embed/${post.extra.youtube}`}
79+ src={`https://www.youtube.com/embed/${event.youtube}`}
7180 frameBorder="0"
7281 allow="encrypted-media"
7382 allowfullscreen
7483 ></iframe>
7584 ) : null}
7685 </Section>
77− <Section narrow className={markdownStyles["markdown"]}>
86+ <Section short narrow className="markdown">
7887 <article
7988 className="pt-12 w-full"
8089 dangerouslySetInnerHTML={{ __html: decode(markdown) }}
@@ -84,23 +93,19 @@ export default function Event({
8493 <Contact />
8594 </Section>
8695 <Section wide className="flex">
87− {previousPost === null ? (
96+ {previousEvent === null ? (
8897 <div className={"w-1/2 mr-4"} />
8998 ) : (
90− <EventPreview
91− title="Previous Event"
92− event={previousPost}
93− className="mr-4 w-1/2"
94− />
99+ <div className="mr-4 w-1/2">
100+ <EventPreview title="Previous Event" event={previousEvent} />
101+ </div>
95102 )}
96− {nextPost === null ? (
103+ {nextEvent === null ? (
97104 <div className={"w-1/2 ml-4"} />
98105 ) : (
99− <EventPreview
100− title="Next Event"
101− event={nextPost}
102− className="ml-4 w-1/2"
103− />
106+ <div className="mr-4 w-1/2">
107+ <EventPreview title="Next Event" event={nextEvent} />
108+ </div>
104109 )}
105110 </Section>
106111 </SingleColumn>
@@ -111,41 +116,81 @@ export default function Event({
111116
112117//
113118export async function getStaticProps({ params }) {
114− const nextPost =
119+ const nextEvent =
115120 getNextPost(
116121 params.slug,
117− ["title", "slug", "date", "description", "extra"],
122+ [
123+ "title",
124+ "slug",
125+ "ends",
126+ "location",
127+ "image",
128+ "registration_url",
129+ "youtube",
130+ "description",
131+ "date",
132+ "hosts",
133+ "guests",
134+ "dark",
135+ ],
118136 "events"
119137 ) || null;
120138
121− const previousPost =
139+ const previousEvent =
122140 getPreviousPost(
123141 params.slug,
124− ["title", "slug", "date", "description", "extra"],
142+ [
143+ "title",
144+ "slug",
145+ "ends",
146+ "location",
147+ "image",
148+ "registration_url",
149+ "youtube",
150+ "description",
151+ "date",
152+ "hosts",
153+ "guests",
154+ "dark",
155+ ],
125156 "events"
126157 ) || null;
127158
128− const post = getPostBySlug(
159+ const event = getPostBySlug(
129160 params.slug,
130− ["title", "slug", "date", "description", "content", "extra"],
161+ [
162+ "title",
163+ "ends",
164+ "location",
165+ "image",
166+ "registration_url",
167+ "youtube",
168+ "description",
169+ "date",
170+ "hosts",
171+ "slug",
172+ "guests",
173+ "content",
174+ "dark",
175+ ],
131176 "events"
132177 );
133178
134− const markdown = await Markdown({ post });
179+ const markdown = await Markdown({ post: event });
135180
136181 return {
137− props: { post, markdown, nextPost, previousPost },
182+ props: { event, markdown, nextEvent, previousEvent },
138183 };
139184}
140185
141186export async function getStaticPaths() {
142− const posts = getAllPosts(["slug", "date"], "events");
187+ const events = getAllPosts(["slug", "date"], "events");
143188
144189 return {
145− paths: posts.map((post) => {
190+ paths: events.map((event) => {
146191 return {
147192 params: {
148− slug: post.slug,
193+ slug: event.slug,
149194 },
150195 };
151196 }),
pages/index.js+12−22
@@ -193,16 +193,12 @@ export default function Home({ posts, events, openGrantsCount, search }) {
193193 </div>
194194
195195 <div className="flex flex-wrap">
196− <PostPreview
197− post={posts[0]}
198− className={`w-full md:w-1/2 pr-0 pb-8 md:pr-4`}
199− key={posts[0].slug}
200− />
201− <PostPreview
202− post={posts[1]}
203− className={`w-full md:w-1/2 pl-0 pb-8 md:pl-4`}
204− key={posts[1].slug}
205− />
196+ <div className="w-full md:w-1/2 pr-0 pb-8 md:pr-4">
197+ <PostPreview post={posts[0]} key={posts[0].slug} />
198+ </div>
199+ <div className="w-full md:w-1/2 pl-0 pb-8 md:pl-4">
200+ <PostPreview post={posts[1]} key={posts[1].slug} />
201+ </div>
206202 </div>
207203 <Link href="/blog">
208204 <button className="button-lg type-ui text-white bg-green-400">
@@ -220,18 +216,12 @@ export default function Home({ posts, events, openGrantsCount, search }) {
220216 </div>
221217
222218 <div className="flex flex-wrap">
223− <EventPreview
224− rsvp
225− event={events[0]}
226− className={`w-full md:w-1/2 pr-0 pb-8 md:pr-4`}
227− key={events[0].slug}
228− />
229− <EventPreview
230− rsvp
231− event={events[1]}
232− className={`w-full md:w-1/2 pl-0 pb-8 md:pl-4`}
233− key={events[1].slug}
234− />
219+ <div className="w-full md:w-1/2 pr-0 pb-8 md:pr-4">
220+ <EventPreview event={events[0]} key={events[0].slug} />
221+ </div>
222+ <div className="w-full md:w-1/2 pl-0 pb-8 md:pl-4">
223+ <EventPreview event={events[1]} key={events[1].slug} />
224+ </div>
235225 </div>
236226 <Link href="/events">
237227 <button className="button-lg type-ui text-white bg-wall-600">
scripts/event_date_upgrade.js+4−1
@@ -35,6 +35,9 @@ fs.readdirSync(dir, { withFileTypes: true })
3535 // hours: 12,
3636 // });
3737
38+ fileContents.data.guests = fileContents.data.contributors;
39+ delete fileContents.data.contributors;
40+
3841 const data = matter.stringify(
3942 fileContents.content,
4043 fileContents.data,
@@ -43,5 +46,5 @@ fs.readdirSync(dir, { withFileTypes: true })
4346
4447 console.log(data);
4548
46− // fs.writeFileSync(path.join(dir, f.name), data);
49+ fs.writeFileSync(path.join(dir, f.name), data);
4750 });