diff --git a/utils/build.js b/utils/build.js index 363e9f9..b1a73fd 100644 --- a/utils/build.js +++ b/utils/build.js @@ -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, diff --git a/web/src/pages/image.astro b/web/src/pages/image.astro deleted file mode 100644 index 1a3f1de..0000000 --- a/web/src/pages/image.astro +++ /dev/null @@ -1,18 +0,0 @@ ---- -import '../styles/base.css'; -import config from '../config.yaml'; - ---- - - - - -
-
- -
-
{config.name}
-
{Astro.url.searchParams}
-
- - \ No newline at end of file diff --git a/web/src/pages/image/[week].astro b/web/src/pages/image/[week].astro new file mode 100644 index 0000000..7464d75 --- /dev/null +++ b/web/src/pages/image/[week].astro @@ -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) + +--- + + + + +
+
+ +
+
{config.name}
+
{format(issue.period[0], "MMM d")} - {format(issue.period[1], "MMM d, yyyy")}
+
+ + \ No newline at end of file