event speakers

This commit is contained in:
tree🌴 2024-02-02 06:12:21 +01:00
parent 5c7f56aeb9
commit e09b317531
4 changed files with 43 additions and 7 deletions

View file

@ -75,6 +75,8 @@ $defs:
"^[\\w]+": "^[\\w]+":
type: string type: string
format: uri format: uri
speakers:
type: array
person: person:
type: object type: object
additionalProperties: false additionalProperties: false

View file

@ -13,6 +13,26 @@
links: links:
web: https://prague.web3privacy.info/ web: https://prague.web3privacy.info/
git: https://github.com/web3privacy/w3ps1 git: https://github.com/web3privacy/w3ps1
speakers:
- ameen-soleimani
- guy-zyskind
- max-hampshire
- antoni-zolciak
- rachel-rose-oleary
- alex-kampa
- oliver-gale
- mario-havel
- costanza-gallo
- manu-alzuru
- nick-almond
- juraj-bednar
- dcbuilder
- alona-shevchenko
- tibor-csoka
- merula
- serinko
- steffen-kux
- althea
- id: w3ps2 - id: w3ps2
type: summit type: summit

View file

@ -18,9 +18,11 @@ core-team:
- name: Coinmandeer - name: Coinmandeer
projects: projects:
$load: projects $load: projects
events:
$load: events
people: people:
$load: people $load: people
$opts: $opts:
loader: person loader: person
events:
$load: events
$opts:
loader: events

View file

@ -26,13 +26,25 @@ export class Engine {
this.rendered = await this.render(this.index); this.rendered = await this.render(this.index);
} }
async loadDir(src, opts = {}) { async loadDir(src, opts = {}, full = {}) {
const out = {}; const out = {};
const dir = join(SRC_DIR, src); const dir = join(SRC_DIR, src);
console.log(`reading dir=${dir}`); console.log(`reading dir=${dir}`);
if (await exists(join(dir, "index.yaml"))) { if (await exists(join(dir, "index.yaml"))) {
const out = readYamlFile(join(dir, "index.yaml")); const out = await readYamlFile(join(dir, "index.yaml"));
if (opts.loader === "events") {
// check speaker connection
for (const ev of out) {
if (ev.speakers) {
for (const spId of ev.speakers) {
if (!full.people.find((p) => p.id === spId)) {
throw new Error(`Speaker not exists: ${spId} (event ${ev.id})`);
}
}
}
}
}
return out; return out;
} }
@ -50,7 +62,7 @@ export class Engine {
if (!ext && !fn.startsWith("_")) { if (!ext && !fn.startsWith("_")) {
const obj = Object.assign( const obj = Object.assign(
{ id: fn }, { id: fn },
await this.loadDir(join(src, fn)), await this.loadDir(join(src, fn), opts, full),
); );
arr.push(obj); arr.push(obj);
} }
@ -78,7 +90,7 @@ export class Engine {
for (const key of Object.keys(src)) { for (const key of Object.keys(src)) {
const val = src[key]; const val = src[key];
if (typeof val === "object" && val.$load) { if (typeof val === "object" && val.$load) {
out[key] = await this.loadDir(val.$load, val.$opts); out[key] = await this.loadDir(val.$load, val.$opts, out);
continue; continue;
} }