Skip to content

Commit 0d4466e

Browse files
authored
Merge branch 'ep2025' into fix-commit-hash-preview
2 parents 16da050 + 7120471 commit 0d4466e

23 files changed

+1882
-3
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"prettier": "^3.5.3",
4949
"prettier-plugin-astro": "^0.14.1",
5050
"tsx": "^4.19.3",
51+
"puppeteer": "^24.7.2",
5152
"typescript": "^5.8.3"
5253
},
5354
"prettier": {

pnpm-lock.yaml

Lines changed: 593 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
184 KB
Loading

public/social/bg.png

108 KB
Loading

public/social/circle.png

8.49 KB
Loading

public/social/color.png

73.3 KB
Loading

public/social/star.svg

Lines changed: 3 additions & 0 deletions
Loading

public/social/web.png

65.4 KB
Loading

scripts/download_social.cjs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const puppeteer = require("puppeteer");
2+
3+
(async () => {
4+
const browser = await puppeteer.launch({
5+
executablePath: process.env.CHROME_BIN,
6+
args: ["--no-sandbox", "--disable-setuid-sandbox"],
7+
});
8+
const page = await browser.newPage();
9+
await page.goto("http://localhost:4321/media/social_media_cards");
10+
11+
const elements = await page.$$(".social");
12+
13+
for (let i = 0; i < elements.length; i++) {
14+
const el = elements[i];
15+
16+
// Get the slug from the element
17+
const slug = await page.evaluate((el) => el.getAttribute("data-slug"), el);
18+
19+
// Fallback if slug is missing
20+
const filename = slug ? `social-${slug}.png` : `social-${i}.png`;
21+
22+
await el.screenshot({ path: filename });
23+
}
24+
25+
await browser.close();
26+
})();
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
import { getCollection, getEntries, type CollectionEntry } from "astro:content";
3+
import { Image } from "astro:assets";
4+
5+
const { entry } = Astro.props;
6+
7+
const sessions = await getEntries(entry.data.submissions);
8+
---
9+
<svg width="900" height="900" class="h-full w-full -z-10">
10+
<image href="http://localhost:4321/social/bg.png" width="900" height="900" />
11+
</svg>
12+
{
13+
entry.data.avatar ? (
14+
<svg width="900" height="900">
15+
<defs>
16+
<clipPath id="curvedCornerClip">
17+
<path
18+
d="
19+
m 885 885 l -240 0 a 240 240 0 0 1 -240 -240 a 240 240 0 0 1 240 -240 a 240 240 0 0 1 240 240 z
20+
"
21+
/>
22+
</clipPath>
23+
</defs>
24+
<image
25+
href={entry.data.avatar}
26+
x="400"
27+
y="400"
28+
width="500"
29+
height="560"
30+
clip-path="url(#curvedCornerClip)"
31+
preserveAspectRatio="xMidYMid slice"
32+
/>
33+
</svg>
34+
<p
35+
class="box fit-text"
36+
>
37+
{sessions.map((session) => <>{session.data.title} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</>)}
38+
</p>
39+
40+
<p lang="en" class="box2 fit-text">
41+
{entry.data.name}
42+
</p>
43+
44+
):(
45+
46+
<p
47+
class="box3 fit-text"
48+
>
49+
{sessions.map((session) => <>{session.data.title} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</>)}
50+
</p>
51+
52+
<p lang="en" class="box4 fit-text">
53+
{entry.data.name}
54+
</p>
55+
56+
)
57+
}
58+
59+
60+
61+
<style>
62+
.box {
63+
margin-top:240px;
64+
width: 430px;
65+
height: 300px;
66+
font-size: 100px;
67+
color: rgb(239, 215, 123);
68+
padding: 1rem;
69+
}
70+
71+
.box2 {
72+
73+
width: 420px;
74+
height: 200px;
75+
font-size: 70px;
76+
color:white;
77+
padding: 2rem;
78+
}
79+
80+
.box3 {
81+
margin-top:280px;
82+
width: 800px;
83+
height: 300px;
84+
font-size: 100px;
85+
color: rgb(239, 215, 123);
86+
padding: 1rem;
87+
}
88+
89+
.box4 {
90+
91+
width: 580px;
92+
height: 200px;
93+
font-size: 70px;
94+
color:white;
95+
padding: 2rem;
96+
}
97+
98+
99+
.box, .box2, .box3, .box4 {
100+
box-sizing: border-box;
101+
overflow: hidden;
102+
display: flex;
103+
align-items: center;
104+
justify-content: center;
105+
text-align: center;
106+
font-family: Inter, sans-serif !important;
107+
font-weight: bold;
108+
line-height: 1em;
109+
}
110+
</style>

0 commit comments

Comments
 (0)