This commit is contained in:
tree🌴 2024-02-12 14:03:51 +01:00
parent 03b144d256
commit 9cbfe2f48d
4 changed files with 40 additions and 0 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

0
google.svg Normal file
View file

View file

@ -38,6 +38,28 @@ async function build() {
} }
await emptyDir(DEST_DIR); await emptyDir(DEST_DIR);
const imgDir = join(DEST_DIR, "img")
await emptyDir(imgDir)
// get images
for (const issue of issues) {
const imgResp = await fetch("https://html2svg.gwei.cz", {
method: 'POST',
body: JSON.stringify({
url: "https://news.web3privacy.info/",
format: "png",
width: 1920,
height: 960,
})
});
const imgFn = join(imgDir, `${issue.week}.png`)
if (imgResp.body) {
const file = await Deno.open(imgFn, { write: true, create: true });
await imgResp.body.pipeTo(file.writable);
}
}
const outputFn = join(DEST_DIR, "index.json"); const outputFn = join(DEST_DIR, "index.json");
await writeJSONFile(outputFn, issues); await writeJSONFile(outputFn, issues);
} }

18
web/src/pages/image.astro Normal file
View file

@ -0,0 +1,18 @@
---
import '../styles/base.css';
import config from '../config.yaml';
---
<html>
<head></head>
<body class="w-full h-full">
<div class="m-16 w-full h-full">
<div class="w-16 mb-14">
<div class="w3pn-logo h-24"></div>
</div>
<div class="text-7xl text-white font-bold">{config.name}</div>
<div class="text-6xl mt-10">{Astro.url.searchParams}</div>
</div>
</body>
</html>