mirror of
https://github.com/web3privacy/news.git
synced 2024-10-15 18:06:26 +02:00
update
This commit is contained in:
parent
9cbfe2f48d
commit
b342a28007
3 changed files with 33 additions and 19 deletions
|
@ -46,7 +46,7 @@ async function build() {
|
||||||
const imgResp = await fetch("https://html2svg.gwei.cz", {
|
const imgResp = await fetch("https://html2svg.gwei.cz", {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
url: "https://news.web3privacy.info/",
|
url: `https://news.web3privacy.info/image/${issue.week}`,
|
||||||
format: "png",
|
format: "png",
|
||||||
width: 1920,
|
width: 1920,
|
||||||
height: 960,
|
height: 960,
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
---
|
|
||||||
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>
|
|
32
web/src/pages/image/[week].astro
Normal file
32
web/src/pages/image/[week].astro
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
---
|
||||||
|
import '../../styles/base.css';
|
||||||
|
import config from '../../config.yaml';
|
||||||
|
import issues from '../../issues.json';
|
||||||
|
const { week } = Astro.params;
|
||||||
|
|
||||||
|
import { setWeek, nextMonday, format, addDays } from 'date-fns';
|
||||||
|
|
||||||
|
export function getStaticPaths() {
|
||||||
|
return issues.map(issue => {
|
||||||
|
return {
|
||||||
|
params: { week: issue.week }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const issue = issues.find(i => i.week === week)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head></head>
|
||||||
|
<body class="w-full h-full">
|
||||||
|
<div class="m-20 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">{format(issue.period[0], "MMM d")} - {format(issue.period[1], "MMM d, yyyy")}</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in a new issue