@@ -8,64 +8,74 @@ import { Separator } from "../components/separator/separator";
8
8
const sessionsCollection = await getCollection (" sessions" );
9
9
10
10
// Define the type for the groups object
11
- type Session = {
11
+ type Session = {
12
12
id: string ;
13
13
data: {
14
- title : string ;
14
+ title: string ;
15
+ session_type: string ;
15
16
};
16
17
};
17
18
18
19
type Groups = {
19
20
[key : string ]: Session [];
20
21
};
21
22
22
- // Group speakers by the first letter of their name
23
23
const groups: Groups = sessionsCollection
24
- .filter ((session : Session ) => !! session .data .title )
24
+ .filter ((session : Session ) => !! session .data .session_type )
25
25
.reduce ((acc : Groups , session : Session ) => {
26
- const letter = session .data .title [ 0 ]. toUpperCase () ;
27
- if (! acc [letter ]) {
28
- acc [letter ] = [];
26
+ const sessionType = session .data .session_type ;
27
+ if (! acc [sessionType ]) {
28
+ acc [sessionType ] = [];
29
29
}
30
- acc [letter ].push (session );
30
+ acc [sessionType ].push (session );
31
31
return acc ;
32
32
}, {} as Groups );
33
33
34
- const letters = Object .keys (groups ).sort ((a , b ) => a .localeCompare (b ));
34
+ // Sort session types alphabetically
35
+ const sessionTypes = Object .keys (groups ).sort ((a , b ) => a .localeCompare (b ));
35
36
36
37
const title = " Sessions" ;
37
38
38
39
const description =
39
- " Alphabetical list of all confirmed sessions for the conference" ;
40
+ " List of all confirmed sessions for the conference, sorted by session type. " ;
40
41
---
41
42
42
43
<Layout title ={ title } description ={ description } >
43
44
<div class =" px-6" >
44
45
<Prose >
45
46
<h1 >Sessions</h1 >
46
- </Prose >
47
+ <p >
48
+ The following sessions are a preliminary list of the confirmed
49
+ proposals that will be part of the conference. The list will keep
50
+ growing in the following days, and some sessions might be replaced in
51
+ case of them being withdrawn by the authors.
52
+ </p >
53
+
47
54
48
- <div class =" flex text-3xl font-bold flex-wrap mb-6" >
55
+ <h2 class =" text-4xl" >Go to session type:</h2 >
56
+ <div class =" text-2xl mb-6" >
57
+ <ul >
49
58
{
50
- letters .map ((letter ) => (
51
- <h3 class = " mr-2" >
52
- <a href = { ` #letter-${ letter } ` } >{ letter } </a >
53
- </h3 >
59
+ sessionTypes .map ((sessionType ) => (
60
+ <li class = " mr-2" >
61
+ <a href = { ` #session-type-${ sessionType } ` } >{ sessionType } </a >
62
+ </li >
54
63
))
55
64
}
65
+ </ul >
56
66
</div >
57
67
58
68
<ol class =" sessions" >
59
69
{
60
- letters .map ((letter , index ) => (
70
+ sessionTypes .map ((sessionType , index ) => (
61
71
<>
62
- <div id = { ` letter-${ letter }` } >
72
+ <div id = { ` session-type-${ sessionType }` } >
63
73
<h2 class = " relative font-title text-primary font-bold mb-[0.6em] [&>a]:border-0 [&>a]:text-inherit text-4xl" >
64
- { letter }
74
+ { sessionType }
65
75
</h2 >
66
76
67
77
<ul class = " pl-4" >
68
- { groups [letter ]
78
+ { groups [sessionType ]
69
79
.sort ((a , b ) => a .data .title .localeCompare (b .data .title ))
70
80
.map ((session ) => (
71
81
<li { ... { key: session .id }} class = " mb-1" >
@@ -80,7 +90,7 @@ const description =
80
90
</ul >
81
91
</div >
82
92
83
- { index !== letters .length - 1 ? (
93
+ { index !== sessionTypes .length - 1 ? (
84
94
<Separator />
85
95
) : (
86
96
<div class = " mb-20" />
@@ -89,5 +99,6 @@ const description =
89
99
))
90
100
}
91
101
</ol >
102
+ </Prose >
92
103
</div >
93
104
</Layout >
0 commit comments