File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff 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 ( ) ;
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ const { entry } = Astro.props;
66
77const 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 >
Original file line number Diff line number Diff 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 ))
You can’t perform that action at this time.
0 commit comments