From 10f38375fb98eb257fd79027b587a70d1c4d5cdd Mon Sep 17 00:00:00 2001 From: Manuel Lieb Date: Sat, 6 Jul 2024 12:54:41 +0200 Subject: [PATCH] feat: use order_ASC for sorting SpeakerList on Homepage --- src/components/SpeakerList.astro | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/SpeakerList.astro b/src/components/SpeakerList.astro index aca66e3..675a3c7 100644 --- a/src/components/SpeakerList.astro +++ b/src/components/SpeakerList.astro @@ -27,7 +27,11 @@ const { const query = graphql( ` - query GetSpeakersPage($limit: Int!, $yearTag: String!) { + query GetSpeakersPage( + $limit: Int! + $yearTag: String! + $order: [TagLinkingCollectionsSpeakerCollectionOrder]! + ) { collection: pageCollection(where: { slug: "speakers" }) { items { title @@ -40,7 +44,7 @@ const query = graphql( tags: tagCollection(limit: 1, where: { title: $yearTag }) { items { linkedFrom { - speakers: speakerCollection(limit: $limit, order: name_ASC) { + speakers: speakerCollection(limit: $limit, order: $order) { items { ...SpeakerCardFragment } @@ -56,6 +60,7 @@ const query = graphql( const data = await client.request(query, { yearTag: SPEAKER_YEAR_TAG_KEY, limit: limit || 200, + order: variant === "light" ? ["order_ASC"] : ["name_ASC"], }); const speakers =