@@ -8,64 +8,74 @@ import { Separator } from "../components/separator/separator";
88const sessionsCollection = await getCollection (" sessions" );
99
1010// Define the type for the groups object
11- type Session = {
11+ type Session = {
1212 id: string ;
1313 data: {
14- title : string ;
14+ title: string ;
15+ session_type: string ;
1516 };
1617};
1718
1819type Groups = {
1920 [key : string ]: Session [];
2021};
2122
22- // Group speakers by the first letter of their name
2323const groups: Groups = sessionsCollection
24- .filter ((session : Session ) => !! session .data .title )
24+ .filter ((session : Session ) => !! session .data .session_type )
2525 .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 ] = [];
2929 }
30- acc [letter ].push (session );
30+ acc [sessionType ].push (session );
3131 return acc ;
3232 }, {} as Groups );
3333
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 ));
3536
3637const title = " Sessions" ;
3738
3839const description =
39- " Alphabetical list of all confirmed sessions for the conference" ;
40+ " List of all confirmed sessions for the conference, sorted by session type. " ;
4041---
4142
4243<Layout title ={ title } description ={ description } >
4344 <div class =" px-6" >
4445 <Prose >
4546 <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+
4754
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 >
4958 {
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 >
5463 ))
5564 }
65+ </ul >
5666 </div >
5767
5868 <ol class =" sessions" >
5969 {
60- letters .map ((letter , index ) => (
70+ sessionTypes .map ((sessionType , index ) => (
6171 <>
62- <div id = { ` letter-${ letter }` } >
72+ <div id = { ` session-type-${ sessionType }` } >
6373 <h2 class = " relative font-title text-primary font-bold mb-[0.6em] [&>a]:border-0 [&>a]:text-inherit text-4xl" >
64- { letter }
74+ { sessionType }
6575 </h2 >
6676
6777 <ul class = " pl-4" >
68- { groups [letter ]
78+ { groups [sessionType ]
6979 .sort ((a , b ) => a .data .title .localeCompare (b .data .title ))
7080 .map ((session ) => (
7181 <li { ... { key: session .id }} class = " mb-1" >
@@ -80,7 +90,7 @@ const description =
8090 </ul >
8191 </div >
8292
83- { index !== letters .length - 1 ? (
93+ { index !== sessionTypes .length - 1 ? (
8494 <Separator />
8595 ) : (
8696 <div class = " mb-20" />
@@ -89,5 +99,6 @@ const description =
8999 ))
90100 }
91101 </ol >
102+ </Prose >
92103 </div >
93104</Layout >
0 commit comments