diff --git a/lib/summary.typ b/lib/summary.typ index 7596b9b..568f5e3 100644 --- a/lib/summary.typ +++ b/lib/summary.typ @@ -130,7 +130,12 @@ lang: "raw-css", ) chtml.summary-card-list(attrs: (class: class-name), { - for summ in summs { + for summ in summs.sorted(key: it => + -(it.document-args.date.day()-1 + 31 * ( + (it.document-args.date.month()-1) + + 12 * it.document-args.date.year() + )) + ) { summ.card } }) diff --git a/test_template/main.typ b/test_template/main.typ index cca7e15..f684e0d 100644 --- a/test_template/main.typ +++ b/test_template/main.typ @@ -164,16 +164,17 @@ thead { caption: [A Big Platypus!] ) +#let perm = (17, 6, 20, 19, 15, 5, 13, 11, 14, 12, 16, 10, 2, 3, 1, 9, 7, 4, 18, 8) #card-list( min-width: 200, - range(1, 21).map(i => + range(20).map(i => summary( url: "http://test.example.com", - title: "Card " + str(i), + title: "Card " + str(perm.at(i)), preview-image: summ.preview-image, author: "Me!", description: lorem(10 * calc.rem(i * 123, 10)), - date: datetime(year: 2000, month: 12, day: i), + date: datetime(year: 2000, month: 12, day: perm.at(i)), ) ) )