From 9cbfe2f48de66ffc9cb2305b565b295e00adbdf1 Mon Sep 17 00:00:00 2001 From: tree Date: Mon, 12 Feb 2024 14:03:51 +0100 Subject: [PATCH] update --- .DS_Store | Bin 0 -> 6148 bytes google.svg | 0 utils/build.js | 22 ++++++++++++++++++++++ web/src/pages/image.astro | 18 ++++++++++++++++++ 4 files changed, 40 insertions(+) create mode 100644 .DS_Store create mode 100644 google.svg create mode 100644 web/src/pages/image.astro diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..4588b346811b00d6c55b36138dc32b82f14ff806 GIT binary patch literal 6148 zcmeHK%}T>S5Z<-XHWVQT1-&hJEto3OikA@U3mDOZN=-=7V9b^#HHT8jU0=u-@p+ut z-H63{6|pn0`_1oe_JiyXV~qRLxXYNs7;8a8>j#3$c{bpi+ z9q`*N7PExqtoZu<(Kt==!gb&ITEkl3Xg2L;yLlTt$TBFxVw(Hm@4klSDvwQH>`E?#4F+dCu1H{0} zGGLB`R(oX`poJ3y#K2Ds;Qk<>A$kTYjcV(F4zJG`w-8Z4$F~HcFz6YqG(rS~>ry~n z%FPpl>vHf5ljj+%H0pB3)yy!CnYn(va5X#lg-U1K(?~rrKnyH0(9ouX=l>b}GD{!% zizQ?c1H`~TV}M(OVBo`|%-Q;Fd3e?eXm`+1Ft0)d1oVYV02sKB?5LoQ3)CUcGgxWF UQP8i-0qG*32%(M`_yq<&0RGlWr2qf` literal 0 HcmV?d00001 diff --git a/google.svg b/google.svg new file mode 100644 index 0000000..e69de29 diff --git a/utils/build.js b/utils/build.js index cc9fcd7..363e9f9 100644 --- a/utils/build.js +++ b/utils/build.js @@ -38,6 +38,28 @@ async function build() { } 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"); await writeJSONFile(outputFn, issues); } diff --git a/web/src/pages/image.astro b/web/src/pages/image.astro new file mode 100644 index 0000000..1a3f1de --- /dev/null +++ b/web/src/pages/image.astro @@ -0,0 +1,18 @@ +--- +import '../styles/base.css'; +import config from '../config.yaml'; + +--- + + + + +
+
+ +
+
{config.name}
+
{Astro.url.searchParams}
+
+ + \ No newline at end of file