@@ -10,6 +10,7 @@ import julioCesar from "../assets/images/workshops/Julio-Cesar-Ruiz.jpg"
10
10
11
11
const workshops = [
12
12
{
13
+ id: " 1" ,
13
14
date: " Vie. 19 abril 2024" ,
14
15
links: [
15
16
" https://www.facebook.com/gdgsucre/videos/1605607886943684/" ,
@@ -34,10 +35,11 @@ const workshops = [
34
35
],
35
36
},
36
37
{
38
+ id: " 2" ,
37
39
date: " Mar. 23 abril 2024" ,
38
40
links: [
39
- " https://www.facebook.com/GDGSantaCruz/videos/980815600258593/" ,
40
41
" https://www.facebook.com/gdgsucre/videos/1661837077980123/" ,
42
+ " https://www.facebook.com/GDGSantaCruz/videos/980815600258593/" ,
41
43
" https://www.facebook.com/GDGCochabamba/videos/956867209435782/" ,
42
44
],
43
45
details: [
@@ -72,31 +74,32 @@ const workshops = [
72
74
<h2 class =" text-2xl sm:text-3xl font-bold mx-auto" >Talleres previos</h2 >
73
75
74
76
{
75
- workshops .map (({ date , links , details }) => {
76
- // choose a random link to avoid favoring any particular chapter
77
- const videoLink = links [Math .floor (Math .random () * links .length )]
78
-
79
- return (
80
- <div class = " space-y-4" >
81
- <div class = " flex items-center space-x-4 mt-6" >
82
- <span class = " w-60 md:w-fit text-nowrap font-bold text-lg md:text-2xl" >{ date } </span >
83
- <hr class = " w-full border-blue-500" />
84
- <a
85
- target = " _blank"
86
- rel = " noopener noreferrer"
87
- href = { videoLink }
88
- class = " text-nowrap text-red-500 hover:bg-red-500 hover:text-black font-semibold border px-1 md:text-lg md:px-2"
89
- >
90
- Ver en Facebook
91
- </a >
92
- </div >
93
-
94
- { details ?.map (detail => (
95
- <WorkshopDetail { ... detail } />
96
- ))}
77
+ workshops .map (({ id , date , details }) => (
78
+ <div class = " space-y-4" >
79
+ <div class = " flex items-center space-x-4 mt-6" >
80
+ <span class = " w-60 md:w-fit text-nowrap font-bold text-lg md:text-2xl" >{ date } </span >
81
+ <hr class = " w-full border-blue-500" />
82
+ <a
83
+ id = { id }
84
+ target = " _blank"
85
+ rel = " noopener noreferrer"
86
+ class = " text-nowrap text-red-500 hover:bg-red-500 hover:text-black font-semibold border px-1 md:text-lg md:px-2"
87
+ >
88
+ Ver en Facebook
89
+ </a >
97
90
</div >
98
- )
99
- })
91
+
92
+ { details ?.map (detail => (
93
+ <WorkshopDetail { ... detail } />
94
+ ))}
95
+ </div >
96
+ ))
100
97
}
101
98
</div >
102
99
</div >
100
+
101
+ <script is:inline define:vars ={ { workshops }} >
102
+ for ({ id, links } of workshops) {
103
+ document.getElementById(id).href = links[Math.floor(Math.random() * links.length)]
104
+ }
105
+ </script >
0 commit comments