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]+":
type: string
format: uri
speakers:
type: array
person:
type: object
additionalProperties: false

View File

@ -13,6 +13,26 @@
links:
web: https://prague.web3privacy.info/
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
type: summit

View File

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

View File

@ -26,13 +26,25 @@ export class Engine {
this.rendered = await this.render(this.index);
}
async loadDir(src, opts = {}) {
async loadDir(src, opts = {}, full = {}) {
const out = {};
const dir = join(SRC_DIR, src);
console.log(`reading dir=${dir}`);
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;
}
@ -50,7 +62,7 @@ export class Engine {
if (!ext && !fn.startsWith("_")) {
const obj = Object.assign(
{ id: fn },
await this.loadDir(join(src, fn)),
await this.loadDir(join(src, fn), opts, full),
);
arr.push(obj);
}
@ -78,7 +90,7 @@ export class Engine {
for (const key of Object.keys(src)) {
const val = src[key];
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;
}