diff --git a/.github/workflows/ipfs-deploy.yml b/.github/workflows/ipfs-deploy.yml index eec67de..c07e99e 100644 --- a/.github/workflows/ipfs-deploy.yml +++ b/.github/workflows/ipfs-deploy.yml @@ -3,8 +3,8 @@ name: Deploy to IPFS on: # Trigger the workflow every time you push to the `main` branch # Using a different branch name? Replace `main` with your branch’s name - push: - branches: [ beta ] + #push: + # branches: [ beta ] # Allow this job to clone the repo and create a page deployment permissions: diff --git a/package.json b/package.json index 122f65b..75f80c5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "w3pn-web", "type": "module", - "version": "1.1.0", + "version": "1.2.0", "scripts": { "dev": "astro dev", "start": "astro dev", diff --git a/src/components/AboutFooter.astro b/src/components/AboutFooter.astro index e1eb195..14fc72f 100644 --- a/src/components/AboutFooter.astro +++ b/src/components/AboutFooter.astro @@ -4,6 +4,30 @@ import * as config from '../config.yaml'; import core from '../core.json'; import contributors from '../contributors.json'; +function findPerson(src) { + const p = core.people.find(p => src.refs?.twitter ? p.refs?.twitter === src.refs.twitter : (src.refs?.bsky ? p.refs.bsky === src.refs.bsky : {})) + if (p) { + p.ct = src + } + return p +} + +function personLink(person) { + return person.refs?.twitter ? `https://twitter.com/${person.refs.twitter}` : (person.refs?.bsky ? `https://bsky.app/profile/${person.refs.bsky}` : '#') +} + +function coreTeamGithubLink(person) { + return `https://github.com/${person.ct.refs.github}` +} + +function filterCoreTeam(person) { + if (person.login) { + return !(core['core-team'].find(ctm => ctm.refs.github.toLowerCase() === person.login.toLowerCase())) + } + const res = core['core-team'].find(ctm => ctm.refs.twitter ? ctm.refs.twitter?.toLowerCase() === person.refs?.twitter?.toLowerCase() : ctm.refs?.bsky?.toLowerCase() === person.refs?.bsky?.toLowerCase()) + return !res +} + ---
@@ -34,13 +58,41 @@ import contributors from '../contributors.json';

Join the Community

{config.landing.community}
-
- {contributors.items.map((contrib) => ( -
+ + +

Speakers

+
+ {core.people.filter(filterCoreTeam).filter(p => p.imageUrl).map((person) => ( +
+ + + +
))}
-
+ + +

Git Contributors

+
+ {contributors.items.filter(filterCoreTeam).map((contrib) => ( +
+ ))} +
+ +
diff --git a/src/components/EventItem.astro b/src/components/EventItem.astro index 732cb65..1b35f0e 100644 --- a/src/components/EventItem.astro +++ b/src/components/EventItem.astro @@ -1,104 +1,13 @@ --- const { item } = Astro.props; -import { format, compareAsc, addDays, isFuture } from 'date-fns'; import { marked } from 'marked'; import EventsExt from '../events-ext.json'; import core from "../core.json"; -import { imageMetadata } from 'astro/assets/utils'; - -function findExt () { - let slug = null - if (item.links?.web && item.links.web.match(/^https:\/\/lu.ma\//)) { - slug = item.links.web.match(/^https:\/\/lu.ma\/(.+)$/)[1] - } - if (item.links?.rsvp && item.links.rsvp.match(/^https:\/\/lu.ma\//)) { - slug = item.links.rsvp.match(/^https:\/\/lu.ma\/(.+)$/)[1] - } - if (!slug) { - return null - } - return EventsExt.find(ex => ex.url === slug) -} - -function getSpeaker (id) { - return core.people.find(p => p.id === id) -} - -const ext = findExt() - - -const isDate = item.date.match(/^\d{4}-\d{2}-\d{2}$/) -const future = isDate && !isFuture(new Date(item.date)); -const dateMatch = item.date.match(/^(\d{4})/) -const year = dateMatch ? dateMatch[1] : null - -function dateFormat (str) { - if (str.match(/^\d{4}-\d{2}-\d{2}$/)) { - return format(new Date(str), 'MMM d, yyyy') - } - const qm = str.match(/^(\d{4})\/(\w+)$/) - if (qm) { - return `${qm[2]}, ${qm[1]}` - } - return str -} - -function nameRenderer (item) { - let num; - let ccm = item.coincidence?.match(/\[(\w+)\]/) - let cc = ccm && ccm[1] ? ccm[1] : (item.coincidence ? item.coincidence : null) - switch (item.type) { - case 'summit': - num = item.id.match(/^w3ps(\d+)$/)[1] - return `W3PN Summmit #${num} ${item.city}`// + (cc ? ` @ ${cc}` : '') - break; - case 'meetup': - num = item.id.match(/(\d+)$/) - return `W3PN Meetup ${item.city} #${num ? num[1] : 'TBD'}`// + (cc ? ` @ ${cc}` : '') - break; - case 'hackathon': - num = item.id.match(/^w3ph(\d+)$/)[1] - return `W3PN Hackathon #${num} ${item.city}`// + (cc ? ` @ ${cc}` : '') - break; - case 'privacy-corner': - return `Privacy Corner at `+ (item.coincidenceFull ? item.coincidenceFull : `${item.coincidence} ${year}`) - break; - } -} - -function ccRenderer (item) { - let ccm = item.coincidence?.match(/\[(\w+)\]/) - let cc = ccm && ccm[1] ? ccm[1] : (item.coincidence ? item.coincidence : null) - return cc -} - -function dateEnd(str, days) { - return format(addDays(new Date(str), days-1), 'yyyy-MM-dd'); -} - -const statuses = { - preregistration: { - title: 'Pre-registration', - color: 'text-orange-500', - }, - unconfirmed: { - title: 'Planned', - color: '' - }, - confirmed: { - title: 'Confirmed', - color: 'text-green-500', - }, - past: { - title: 'Already happened', - color: 'text-green-800', - } -} - -const status = item.confirmed - ? (future ? statuses.past : statuses.confirmed) - : (item.links?.rsvp ? statuses.preregistration : statuses.unconfirmed); +import { dateFormat, dateInfo, dateEnd, nameRenderer, ccRenderer, eventStatus, getSpeaker, findExt } from '../lib/events.js'; +import SpeakerList from './SpeakerList.astro'; +const ext = findExt(EventsExt, item) +const status = eventStatus(item) ---
@@ -112,7 +21,7 @@ const status = item.confirmed
- {nameRenderer(item)} + {nameRenderer(item)}
{item.type === "hackathon" && HACKATHON} {item.type === "summit" && SUMMIT} @@ -135,7 +44,7 @@ const status = item.confirmed
{item.speakers &&
- {item.speakers.map(spId => getSpeaker(spId)).slice(0,7).map((speaker) => ( + {item.speakers.map(spId => getSpeaker(core, spId)).slice(0,7).map((speaker) => (
))} {item.speakers.length > 7 && @@ -169,7 +78,7 @@ const status = item.confirmed
Date: {dateFormat(item.date)} {item.days ? ' - ' + dateFormat(dateEnd(item.date, item.days)) + ` (${item.days} days)` : ''}
- Place: {item.place && || "TBD"} + Venue: {item.place && || "TBD"} {item.place && item['place-address'] && @ {item['place-address']} @@ -187,27 +96,7 @@ const status = item.confirmed }
- {item.speakers && -
-

Speakers ({item.speakers.length})

-
- {item.speakers.map(spId => getSpeaker(spId)).map((speaker) => ( -
-
-
-
- {speaker.name} - {speaker.refs?.twitter && - (@{speaker.refs.twitter}) - } -
-
-
-
- ))} -
-
- } +
\ No newline at end of file diff --git a/src/components/SpeakerList.astro b/src/components/SpeakerList.astro new file mode 100644 index 0000000..24b270c --- /dev/null +++ b/src/components/SpeakerList.astro @@ -0,0 +1,44 @@ +--- +import { marked, } from 'marked'; +const { item, thumbSize } = Astro.props; +import { getSpeaker } from '../lib/events.js'; +import core from "../core.json"; + +--- + +{item.speakers && +
+

Speakers ({item.speakers.length})

+
+ {item.speakers.map(spId => getSpeaker(core, spId)).map((speaker) => ( +
+
+
+
+ {speaker.name} + {speaker.refs?.twitter && + (@{speaker.refs.twitter}) + } +
+
+
+
+ ))} +
+ + +
+} +{!item.speakers && +
+

Speakers (0)

+ +
Stay tuned. Speakers coming :-)
+ + +
+} \ No newline at end of file diff --git a/src/contributors.json b/src/contributors.json index dcab415..ab23ad6 100644 --- a/src/contributors.json +++ b/src/contributors.json @@ -58,7 +58,7 @@ "received_events_url": "https://api.github.com/users/burningtree/received_events", "type": "User", "site_admin": false, - "contributions": 694 + "contributions": 699 }, { "login": "EclecticSamurai", diff --git a/src/core.json b/src/core.json index 2197b39..d88f28c 100644 --- a/src/core.json +++ b/src/core.json @@ -15,7 +15,8 @@ "forum": "https://forum.web3privacy.info", "explorer": "https://explorer.web3privacy.info", "news": "https://news.web3privacy.info", - "telegram": "https://t.me/web3privacynow" + "telegram": "https://t.me/web3privacynow", + "cfp": "https://cfp.web3privacy.info" }, "core-team": [ { @@ -539,7 +540,7 @@ ], "events": [ { - "id": "w3ps1", + "id": "s23prg", "type": "summit", "date": "2023-06-05", "city": "Prague", @@ -581,7 +582,7 @@ ] }, { - "id": "w3ps2", + "id": "s23rom", "type": "summit", "date": "2023-10-05", "city": "Rome", @@ -616,7 +617,7 @@ ] }, { - "id": "w3pm-prg1", + "id": "m23prg", "type": "meetup", "date": "2023-11-14", "city": "Prague", @@ -638,7 +639,8 @@ ] }, { - "id": "w3pm-ath1", + "id": "m24ath", + "issue": 22, "type": "meetup", "date": "2024/Mar", "city": "Athens", @@ -653,7 +655,8 @@ ] }, { - "id": "w3pm-buc1", + "id": "m24buc", + "issue": 8, "type": "meetup", "date": "2024-03-28", "city": "Bucharest", @@ -675,7 +678,8 @@ ] }, { - "id": "w3pm-ams1", + "id": "m24ams", + "issue": 9, "type": "meetup", "date": "2024-04-11", "city": "Amsterdam", @@ -698,7 +702,8 @@ ] }, { - "id": "w3pm-tal1", + "id": "m24tll", + "issue": 10, "type": "meetup", "date": "2024-04-18", "city": "Tallinn", @@ -712,7 +717,8 @@ } }, { - "id": "w3pm-por1", + "id": "m24opo", + "issue": 21, "type": "meetup", "date": "2024/May", "city": "Porto", @@ -725,7 +731,8 @@ ] }, { - "id": "w3pm-ber1", + "id": "m24ber", + "issue": 6, "type": "meetup", "tags": [ "sfe" @@ -750,7 +757,8 @@ } }, { - "id": "w3ps3", + "id": "s24prg", + "issue": 11, "type": "summit", "date": "2024-05-30", "city": "Prague", @@ -773,7 +781,8 @@ ] }, { - "id": "w3ph1", + "id": "h24ble", + "issue": 7, "type": "hackathon", "date": "2024-06-19", "days": 7, @@ -802,7 +811,8 @@ ] }, { - "id": "w3pm-lju1", + "id": "m24lju", + "issue": 12, "type": "meetup", "date": "2024-06-21", "city": "Ljubljana", @@ -823,7 +833,8 @@ ] }, { - "id": "w3pm-bcn1", + "id": "m24bcn", + "issue": 20, "type": "meetup", "date": "2024/Jul", "city": "Barcelona", @@ -833,7 +844,8 @@ "optional": true }, { - "id": "w3pm-bru1", + "id": "m24bru", + "issue": 16, "type": "meetup", "date": "2024-07-12", "city": "Brussels", @@ -852,7 +864,8 @@ ] }, { - "id": "w3pm-waw1", + "id": "m24waw", + "issue": 19, "type": "meetup", "date": "2024/Sep", "city": "Warsaw", @@ -863,7 +876,8 @@ "optional": true }, { - "id": "w3pm-cph1", + "id": "m24cph", + "issue": 18, "type": "meetup", "date": "2024/Sep", "city": "Copenhagen", @@ -877,7 +891,8 @@ ] }, { - "id": "w3pm-rom2", + "id": "m24rom", + "issue": 13, "type": "meetup", "date": "2024-10-04", "city": "Rome", @@ -897,7 +912,8 @@ ] }, { - "id": "pc-rome-2024", + "id": "c24rom", + "issue": 23, "type": "privacy-corner", "date": "2024-10-04", "days": 3, @@ -908,7 +924,8 @@ "lead": "Tree" }, { - "id": "w3ps4", + "id": "s24brn", + "issue": 14, "type": "summit", "date": "2024-10-24", "city": "Brno", @@ -931,7 +948,8 @@ ] }, { - "id": "pc-brno-2024", + "id": "c24brn", + "issue": 24, "type": "privacy-corner", "date": "2024-10-25", "days": 3, @@ -942,7 +960,8 @@ "lead": "Tree" }, { - "id": "w3pm-dc1", + "id": "m24dc", + "issue": 15, "type": "meetup", "date": "2024-11-11", "city": "Bangkok", diff --git a/src/layouts/base.astro b/src/layouts/base.astro index 41363cf..8819af5 100644 --- a/src/layouts/base.astro +++ b/src/layouts/base.astro @@ -5,7 +5,7 @@ import * as config from '../config.yaml'; import * as pkg from '../../package.json'; import core from '../core.json'; import '../styles/base.css'; -const {banner, title, description} = Astro.props; +const {banner, title, metaTitle, description} = Astro.props; import cfonts from 'cfonts'; @@ -21,7 +21,7 @@ function genHeading(str) { - {title ? title + ' | ' + config.title : config.title} + {(metaTitle || title) ? ((metaTitle || title) + ' | ' + config.title) : config.title} p.id === id) +} + +export function findExt (eventsExt, item) { + let slug = null + if (item.links?.web && item.links.web.match(/^https:\/\/lu.ma\//)) { + slug = item.links.web.match(/^https:\/\/lu.ma\/(.+)$/)[1] + } + if (item.links?.rsvp && item.links.rsvp.match(/^https:\/\/lu.ma\//)) { + slug = item.links.rsvp.match(/^https:\/\/lu.ma\/(.+)$/)[1] + } + if (!slug) { + return null + } + return eventsExt.find(ex => ex.url === slug) +} \ No newline at end of file diff --git a/src/pages/event/[id].astro b/src/pages/event/[id].astro new file mode 100644 index 0000000..e2a3d05 --- /dev/null +++ b/src/pages/event/[id].astro @@ -0,0 +1,92 @@ +--- + +import BaseLayout from '../../layouts/base.astro'; +import SpeakerList from '../../components/SpeakerList.astro'; +import core from '../../core.json'; +import EventsExt from '../../events-ext.json'; +import { dateFormat, dateInfo, dateEnd, nameRenderer, ccRenderer, eventStatus, findExt } from '../../lib/events.js'; +import { marked } from 'marked'; + +const { id } = Astro.params; + +export async function getStaticPaths() { + return core.events.map(event => ({ params: { id: event.id }})); +} + +const item = core.events.find(event => event.id === id) +const status = eventStatus(item) +const ext = findExt(EventsExt, item) +--- + + + +
+ +
+
+
+
+
+

W3PN {nameRenderer(item, true)}

+ +
+ +
+ {item.city}, {item.country.toUpperCase()} + {item.coincidence && +  - {ccRenderer(item)} + } +
+
+ +
+
Date: {dateFormat(item.date)} {item.days ? ' - ' + dateFormat(dateEnd(item.date, item.days)) + ` (${item.days} days)` : ''}
+
+ Venue: {item.place && || "TBD"} + {item.place && item['place-address'] && + @ + {item['place-address']} + } +
+
Status: {status.title}
+
Visitors: + {item.visitors && + {item.visitors} people + } + {!item.visitors && ext && + {ext.guestCount > 0 ? (ext.guestCount + ' people') : 'n/a'} {status.title === 'Pre-registration' ? 'pre-registered' : 'registered'} + } + {!item.visitors && !ext && + n/a + } +
+
+ {item.links?.rsvp && + + } + {item.links?.web && + + } +
+
+
+
+ +
+
ID: {item.id}
+
Lead: {item.lead || 'n/a'}
+
+ {item.links?.rsvp && + Lu.ma + } + {item.issue && + PM + } + Source +
+
+ + +
+ +
\ No newline at end of file diff --git a/src/pages/events.astro b/src/pages/events.astro index 56ad358..2888dc2 100644 --- a/src/pages/events.astro +++ b/src/pages/events.astro @@ -69,6 +69,9 @@ for (const year of pastYears.reverse()) { if (ev.target.tagName === "BUTTON") { return false; } + if (ev.target.tagName === "A") { + return false; + } const detail = el.parentElement.parentElement.querySelector('.detail') document.querySelectorAll('.detail:not(.hidden)').forEach(e => (detail !== e ? e.classList.add('hidden') : null)); detail.classList.toggle('hidden'); diff --git a/src/styles/base.css b/src/styles/base.css index c1eec7f..692be5a 100644 --- a/src/styles/base.css +++ b/src/styles/base.css @@ -193,6 +193,10 @@ @apply mb-4; } + .w3pn-speaker-list a { + @apply hover:text-white; + } + .icon { @apply inline-block w-12 h-12; }