Skip to content

Commit

Permalink
fix: sort writeups by points and then by ctf data
Browse files Browse the repository at this point in the history
  • Loading branch information
xhyrom committed Apr 10, 2024
1 parent e165318 commit c3091a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ const writeups = (
(await getCollection("writeups")).map((writeup) => parseWriteUp(writeup)),
)
)
.sort((a, b) => b.data.points - a.data.points)
.sort(
(a, b) => b.ctf.data.dateStart.valueOf() - a.ctf.data.dateStart.valueOf(),
)
.sort((a, b) => b.data.points - a.data.points)
.slice(0, SITE.NUM_WRITEUPS_ON_HOMEPAGE);
const ctfs = (await getCollection("ctfs"))
Expand Down

0 comments on commit c3091a7

Please sign in to comment.