Merge branch 'main' into main

This commit is contained in:
tree🌴 2024-02-13 12:49:36 +01:00 committed by GitHub
commit dda503650c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 123 additions and 44 deletions

View File

@ -1,5 +1,6 @@
--- ---
curator: Tree curator: Tree
published: https://paragraph.xyz/@privacynews/2024-06
--- ---
Welcome to the historical debut - the **first edition** (#1) of [Week In The Privacy News](https://news.web3privacy.info/). Welcome to the historical debut - the **first edition** (#1) of [Week In The Privacy News](https://news.web3privacy.info/).

View File

@ -5,3 +5,13 @@ curator: Mykola
### Research ### Research
* [Technical exploration of Erasure Coding](https://papers.ethswarm.org/p/erasure/) within the Swarm network, focusing on ensuring data integrity and resilience -- [@GasperX93](https://github.com/GasperX93) * [Technical exploration of Erasure Coding](https://papers.ethswarm.org/p/erasure/) within the Swarm network, focusing on ensuring data integrity and resilience -- [@GasperX93](https://github.com/GasperX93)
### Ecosystem
* [Eppie](https://eppie.io/): encrypted p2p email as better replacement for Skiff ([src](https://blog.eppie.io/post/nextgen/))
* [Eternal Safe](https://github.com/eternalsafe/wallet/): decentralized fork of Safe{Wallet} without tracking ([src](https://twitter.com/devanoneth/status/1756861443310305780))
* [koan](https://twitter.com/koanpay): private cross-chain swaps by Zcash ([src](https://twitter.com/koanpay/status/1757088529698734366))
### Releases
* Noir [v0.24.0](https://github.com/noir-lang/noir/releases) (pre-release)

View File

@ -43,23 +43,12 @@ async function build() {
// get images // get images
for (const issue of issues) { for (const issue of issues) {
const imgResp = await fetch("https://html2svg.gwei.cz", { await genImage(`https://news.web3privacy.info/image/${issue.week}?${new Date().valueOf()}`, join(imgDir, `${issue.week}.png`))
method: 'POST',
body: JSON.stringify({
url: `https://news.web3privacy.info/image/${issue.week}?${new Date().valueOf()}`,
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);
}
} }
// make cover
await genImage(`https://news.web3privacy.info/cover`, join(imgDir, 'cover.png'))
const outputFn = join(DEST_DIR, "index.json"); const outputFn = join(DEST_DIR, "index.json");
await writeJSONFile(outputFn, issues); await writeJSONFile(outputFn, issues);
} }
@ -91,4 +80,21 @@ async function writeJSONFile(fn, data) {
return Deno.writeTextFile(fn, JSON.stringify(data, null, 2)); return Deno.writeTextFile(fn, JSON.stringify(data, null, 2));
} }
async function genImage(url, fn) {
const imgResp = await fetch("https://html2svg.gwei.cz", {
method: 'POST',
body: JSON.stringify({
url,
format: "png",
width: 1920,
height: 960,
})
});
if (imgResp.body) {
const file = await Deno.open(fn, { write: true, create: true });
await imgResp.body.pipeTo(file.writable);
}
}
build(); build();

View File

@ -0,0 +1,25 @@
---
const { title, description, image } = Astro.props;
---
<meta name="viewport" content="width=device-width" />
<meta name="generator" content={Astro.generator} />
<title>{title}</title>
<meta name="title" content={title} />
<meta name="description" content={description} />
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website" />
<meta property="og:url" content="https://news.web3privacy.info/" />
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="og:image" content={image} />
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content="https://news.web3privacy.info" />
<meta property="twitter:title" content={title} />
<meta property="twitter:description" content={description} />
<meta property="twitter:image" content={image} />

View File

@ -13,7 +13,7 @@ const current = false;
<div class=`sm:flex w-full p-4 sm:p-6 bg-white/10`> <div class=`sm:flex w-full p-4 sm:p-6 bg-white/10`>
<div class="grid gap-2 sm:gap-6 sm:flex items-center"> <div class="grid gap-2 sm:gap-6 sm:flex items-center">
<h1 class="text-2xl"><a href=`/issue/${issue.week}`>Week {issue.week.split('-').reverse().join('/')}</a></h1> <h1 class="text-2xl"><a href=`/${issue.week}`>Week {issue.week.split('-').reverse().join('/')}</a></h1>
<div class=`text-xl ${current ? "text-white/50" : ""}`>{format(issue.period[0], "MMM d")} - {format(issue.period[1], "MMM d, yyyy")}</div> <div class=`text-xl ${current ? "text-white/50" : ""}`>{format(issue.period[0], "MMM d")} - {format(issue.period[1], "MMM d, yyyy")}</div>
{!issue.published && {!issue.published &&
<div class="text-white">🚧 Future edition</div> <div class="text-white">🚧 Future edition</div>
@ -23,8 +23,11 @@ const current = false;
<div class="mt-2 sm:mt-0 flex gap-4 items-center"> <div class="mt-2 sm:mt-0 flex gap-4 items-center">
{issue.published && {issue.published &&
<a href={issue.published}>Paragraph</a> <a href={issue.published}>Paragraph</a>
<a href=`https://github.com/web3privacy/news/blob/main/data/${year}/week${week}.md`>Source</a>
}
{!issue.published &&
<a href=`https://github.com/web3privacy/news/edit/main/data/${year}/week${week}.md`>Edit</a>
} }
<a href=`https://github.com/web3privacy/news/edit/main/data/${year}/week${week}.md`>{issue.published ? 'Source' : 'Edit'}</a>
</div> </div>
</div> </div>

View File

@ -1,15 +1,23 @@
--- ---
import '../styles/base.css'; import '../styles/base.css';
import config from '../config.yaml'; import config from '../config.yaml';
import MetaTags from '../components/MetaTags.astro';
const { title, description, image } = Astro.props;
--- ---
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width" />
<meta name="generator" content={Astro.generator} /> <MetaTags
<title>{config.name} | Web3Privacy Now</title> title={title ? title : config.name}
description={description ? description : config.template.preview}
image={image ? image : 'https://news.web3privacy.info/img/cover.png'}
/>
</head> </head>
<body> <body>
<div class="m-4 sm:m-8"> <div class="m-4 sm:m-8">

View File

@ -0,0 +1,29 @@
---
import BaseLayout from '../layouts/base.astro';
import WeekNews from '../components/WeekNews.astro';
import issues from '../issues.json';
import config from '../config.yaml';
export function getStaticPaths() {
return issues.map(issue => {
return {
params: { week: issue.week }
}
})
}
const { week } = Astro.params;
const issue = issues.find(item => item.week === week);
---
<BaseLayout
title=`${config.name} - ${issue.week.split('-').reverse().join('/')}`,
description=`${config.template.preview}`
image=`https://news.web3privacy.info/img/${issue.week}.png`
>
<div class="mb-8">
<a href="/">← Show latest edition</a>
</div>
<WeekNews {issue} isFull={true} />
</BaseLayout>

21
web/src/pages/cover.astro Normal file
View File

@ -0,0 +1,21 @@
---
import '../styles/base.css';
import config from '../config.yaml';
---
<html>
<head></head>
<body class="h-screen">
<div class="grid h-full">
<div class="mt-48 ml-48">
<div class="text-8xl text-white font-bold">{config.name}</div>
</div>
<div class="flex h-full items-end justify-end">
<div class="mr-48 mb-48">
<div class="w3pn-logo h-32"></div>
</div>
</div>
</div>
</body>
</html>

View File

@ -1,24 +0,0 @@
---
import BaseLayout from '../../layouts/base.astro';
import WeekNews from '../../components/WeekNews.astro';
import issues from '../../issues.json';
export function getStaticPaths() {
return issues.map(issue => {
return {
params: { week: issue.week }
}
})
}
const { week } = Astro.params;
const issue = issues.find(item => item.week === week);
---
<BaseLayout>
<div class="mb-8">
<a href="/">← Show latest edition</a>
</div>
<WeekNews {issue} isFull={true} />
</BaseLayout>