File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -34,3 +34,7 @@ export const sortJobsByDate = (jobs: CollectionEntry<'jobs'>[]) => {
3434 return nextEnd - currentEnd || next . data . from - current . data . from ;
3535 } ) ;
3636} ;
37+
38+ export const sortTalksByYear = ( talks : CollectionEntry < 'talks' > [ ] ) => {
39+ return talks . sort ( ( a , b ) => b . data . year - a . data . year ) ;
40+ } ;
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import Author from '@/components/ui/Author.astro';
66import { DEFAULT_CONFIGURATION } from ' @/lib/constants' ;
77import WorkExperience from ' @/components/ui/WorkExperience.astro' ;
88import Talk from ' @/components/ui/Talk.astro' ;
9- import { sortJobsByDate } from ' @/lib/utils' ;
9+ import { sortJobsByDate , sortTalksByYear } from ' @/lib/utils' ;
1010
1111const entry = await getEntry (' pages' , ' homepage' );
1212
@@ -20,6 +20,7 @@ const links = await getCollection('links');
2020const jobs = await getCollection (' jobs' );
2121const sortedJobs = sortJobsByDate (jobs );
2222const talks = await getCollection (' talks' );
23+ const sortedTalks = sortTalksByYear (talks );
2324---
2425
2526<BaseLayout seo ={ entry .data .seo } >
@@ -85,7 +86,7 @@ const talks = await getCollection('talks');
8586 <div class = " flex flex-col gap-5" >
8687 <span class = " text-headings" >Speaking</span >
8788 <ul class = " flex flex-col gap-8" >
88- { talks .map ((talk ) => (
89+ { sortedTalks .map ((talk ) => (
8990 <Talk entry = { talk } />
9091 ))}
9192 </ul >
You can’t perform that action at this time.
0 commit comments