This commit is contained in:
tree 2023-01-23 20:40:25 +01:00
rodič 403de0d37c
revize 2d81e7861e
11 změnil soubory, kde provedl 57 přidání a 8 odebrání

Zobrazit soubor

@ -3,12 +3,14 @@
{
"name": "Anita Posch",
"photoUrl": "https://www.btcprague.com/wp-content/uploads/2023/01/Anita-Posch-2-320x320.png",
"bio": "Bitcoin educator & author"
"bio": "Bitcoin educator & author",
"photo": "photos/speakers/anita-posch.png"
},
{
"name": "Dušan Matuška",
"photoUrl": "https://www.btcprague.com/wp-content/uploads/2023/01/Dusan-Matuska-320x320.png",
"bio": "Bitcoin educator & miner"
"bio": "Bitcoin educator & miner",
"photo": "photos/speakers/dušan-matuška.png"
},
{
"name": "Roman Reher",
@ -17,23 +19,27 @@
"twitter": "blocktrainer",
"web": {
"url": "https://www.blocktrainer.de/"
}
},
"photo": "photos/speakers/roman-reher.jpg"
},
{
"name": "Giacomo Zucco",
"photoUrl": "https://www.btcprague.com/wp-content/uploads/2022/11/btcprague-giacomozucco-320x320.jpg",
"bio": "Bitcoin entrepreneur & consultant",
"twitter": "giacomozucco"
"twitter": "giacomozucco",
"photo": "photos/speakers/giacomo-zucco.jpg"
},
{
"name": "Wolf von Laer",
"photoUrl": "https://www.btcprague.com/wp-content/uploads/2023/01/Wolf-von-Laer-320x320.jpg",
"bio": "CEO of Students For Liberty"
"bio": "CEO of Students For Liberty",
"photo": "photos/speakers/wolf-von-laer.jpg"
},
{
"name": "Benjamin de Waal",
"photoUrl": "https://www.btcprague.com/wp-content/uploads/2023/01/Ben-de-Waal.jpg",
"bio": "VP Engineering of Swan Bitcoin"
"bio": "VP Engineering of Swan Bitcoin",
"photo": "photos/speakers/benjamin-de-waal.jpg"
},
{
"name": "Stephan Livera",
@ -42,13 +48,15 @@
"twitter": "stephanlivera",
"web": {
"url": "https://stephanlivera.com/"
}
},
"photo": "photos/speakers/stephan-livera.jpg"
},
{
"name": "Gleb Naumenko",
"photoUrl": "https://www.btcprague.com/wp-content/uploads/2022/11/btcprague-glebnaumenko-320x320.jpg",
"bio": "Bitcoin Core and Lightning Network developer",
"twitter": "ffstls"
"twitter": "ffstls",
"photo": "photos/speakers/gleb-naumenko.jpg"
}
]
}

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 33 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 26 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 71 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 16 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 28 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 18 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 13 KiB

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 10 KiB

binární
data/23/events/privacyeth/logo.jpg Normal file

Binární soubor nebyl zobrazen.

Za

Šířka:  |  Výška:  |  Velikost: 32 KiB

Zobrazit soubor

@ -1,6 +1,7 @@
import {
copy,
emptyDir,
ensureDir,
exists,
} from "https://deno.land/std@0.173.0/fs/mod.ts";
import { parse as tomlParse } from "https://deno.land/std@0.173.0/encoding/toml.ts";
@ -184,7 +185,28 @@ class DeConf_Collection {
if (!JSON.stringify(data)) {
return null;
}
if (data.speakers) {
const photosDir = [this.dir, "photos"].join("/");
await emptyDir(photosDir);
for (const sp of data.speakers) {
if (!sp.photoUrl) continue;
const photoFetch = await fetch(sp.photoUrl);
const ext = await posix.extname(sp.photoUrl);
const dir = [photosDir, "speakers"].join("/");
await ensureDir(dir);
const nameId = sp.name.toLowerCase().replace(/ /g, "-");
if (photoFetch.body) {
const fn = [dir, nameId + ext].join("/");
console.log(`${fn} writed`);
const file = await Deno.open(fn, { write: true, create: true });
await photoFetch.body.pipeTo(file.writable);
sp.photo = ["photos", "speakers", nameId + ext].join("/");
}
}
}
await _jsonWrite([this.dir, "data.json"].join("/"), data);
this.data.sync = data;
}
}
@ -198,6 +220,25 @@ class DeConf_Collection {
const url = [publicUrl, fnOut].join("/");
this.data.index[asset] = url;
}
if (this.data.sync && this.data.sync.speakers) {
const outDir = [outputDir, this.id, "photos", "speakers"].join("/");
await ensureDir(outDir);
for (const sp of this.data.sync.speakers) {
if (!sp.photo) continue;
const srcFile = [this.dir, sp.photo].join("/");
if (await exists(srcFile)) {
const outFile = [outDir, posix.basename(sp.photo)].join("/");
await _fileCopy(srcFile, outFile);
sp.photoUrl = [
publicUrl,
this.id,
"photos",
"speakers",
posix.basename(sp.photo),
].join("/");
}
}
}
}
toJSON() {