This commit is contained in:
tree🌴 2024-02-12 14:09:02 +01:00
parent 9cbfe2f48d
commit b342a28007
3 changed files with 33 additions and 19 deletions

View File

@ -46,7 +46,7 @@ async function build() {
const imgResp = await fetch("https://html2svg.gwei.cz", {
method: 'POST',
body: JSON.stringify({
url: "https://news.web3privacy.info/",
url: `https://news.web3privacy.info/image/${issue.week}`,
format: "png",
width: 1920,
height: 960,

View File

@ -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>

View 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>