This commit is contained in:
tree 2023-01-23 01:25:49 +01:00
rodič d1f8a250dd
revize 01e8b0dc06
2 změnil soubory, kde provedl 12 přidání a 9 odebrání

Zobrazit soubor

@ -1,8 +1,7 @@
# Prague Blockchain Week (PBW)
[![Test, build, deploy](https://github.com/utxo-foundation/prague-blockchain-week/actions/workflows/deploy.yml/badge.svg?branch=main)](https://github.com/utxo-foundation/prague-blockchain-week/actions/workflows/deploy.yml) [![pages-build-deployment](https://github.com/utxo-foundation/prague-blockchain-week/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/utxo-foundation/prague-blockchain-week/actions/workflows/pages/pages-build-deployment)
[![Test, build, deploy](https://github.com/utxo-foundation/prague-blockchain-week/actions/workflows/deploy.yml/badge.svg?branch=main)](https://github.com/utxo-foundation/prague-blockchain-week/actions/workflows/deploy.yml)
[![pages-build-deployment](https://github.com/utxo-foundation/prague-blockchain-week/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/utxo-foundation/prague-blockchain-week/actions/workflows/pages/pages-build-deployment)
A decentralized conference hosted by
[UTXO Foundation](https://utxo.foundation/). We are using this GitHub repository
@ -20,4 +19,4 @@ to coordinate event listings.
[Creative Commons Zero v1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/)
![CC0](https://upload.wikimedia.org/wikipedia/commons/6/69/CC0_button.svg)
![CC0](https://upload.wikimedia.org/wikipedia/commons/6/69/CC0_button.svg)

Zobrazit soubor

@ -9,7 +9,8 @@ export class DeConfEngine {
this.srcDir = this.options.srcDir || "./data";
this.outputDir = this.options.outputDir || "./dist";
this.publicUrl = this.options.publicUrl || "https://data.prgblockweek.com";
this.githubUrl = this.options.githubUrl || "https://github.com/utxo-foundation/prague-blockchain-week/tree/main/data";
this.githubUrl = this.options.githubUrl ||
"https://github.com/utxo-foundation/prague-blockchain-week/tree/main/data";
}
async init() {}
async build() {
@ -18,7 +19,7 @@ export class DeConfEngine {
this.entries = [];
for await (const f of Deno.readDir(this.srcDir)) {
if (!f.name.match(/^\d+$/)) continue;
const pkg = new DeConf_Package(f.name);
const pkg = new DeConf_Package(f.name, this);
await pkg.load([this.srcDir, f.name]);
console.table(pkg.data.events.map((e) => e.data.index), ["name"]);
await pkg.write(this.outputDir);
@ -29,23 +30,26 @@ export class DeConfEngine {
this.entries.map((p) => ({
id: p.id,
name: p.data.index.name,
dataUrl: [this.publicUrl, p.id].join("/"),
githubUrl: [this.githubUrl, p.id].join("/")
dataUrl: p.data.index.dataUrl,
dataGithubUrl: p.data.index.dataGithubUrl,
})),
);
}
}
class DeConf_Package {
constructor(id) {
constructor(id, engine) {
this.id = id;
this.data = null;
this.engine = engine;
}
async load(specDir) {
const pkg = {};
// load year index
pkg.index = await _tomlLoad([...specDir, "index.toml"].join("/"));
pkg.index.dataUrl = [this.engine.publicUrl, this.id].join("/");
pkg.index.dataGithubUrl = [this.engine.githubUrl, this.id].join("/");
console.log(`\n##\n## [${pkg.index.name}] \n##`);
// load sub-events
pkg.events = [];