Skip to content

Commit 7ee0824

Browse files
committed
Add names to filename.
1 parent c65d86a commit 7ee0824

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

scripts/download_social.cjs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,14 @@ const puppeteer = require("puppeteer");
1111

1212
for (let i = 0; i < elements.length; i++) {
1313
const el = elements[i];
14-
await el.screenshot({ path: `social-${i}.png` });
14+
15+
// Get the slug from the element
16+
const slug = await page.evaluate((el) => el.getAttribute("data-slug"), el);
17+
18+
// Fallback if slug is missing
19+
const filename = slug ? `social-${slug}.png` : `social-${i}.png`;
20+
21+
await el.screenshot({ path: filename });
1522
}
1623

1724
await browser.close();

src/components/SocialMediaCard.astro

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const { entry } = Astro.props;
66
77
const sessions = await getEntries(entry.data.submissions);
88
---
9-
9+
<div class="slug">{entry.data.slug}</div>
1010
<svg width="900" height="900" class="h-full w-full -z-10">
1111
<image href="http://localhost:4321/social/bg.png" width="900" height="900" />
1212
</svg>
@@ -109,4 +109,8 @@ const sessions = await getEntries(entry.data.submissions);
109109
line-height: 1em;
110110
}
111111

112+
.sulg{
113+
display:none;
114+
}
115+
112116
</style>

src/pages/media/social_media_cards.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type Speaker = CollectionEntry<"speakers">;
2020
<body class="overflow-auto">
2121
{
2222
speakers.map((entry: Speaker) => (
23-
<div class="social relative w-[900px] h-[900px] overflow-hidden">
23+
<div class="social relative w-[900px] h-[900px] overflow-hidden" data-slug={entry.data.slug}>
2424
<SocialMediaCard entry={entry} />
2525
</div>
2626
))

0 commit comments

Comments
 (0)