We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 675d316 + 5225d15 commit 77d43cfCopy full SHA for 77d43cf
1 file changed
src/pages/session/[slug].astro
@@ -26,6 +26,18 @@ const { entry } = Astro.props;
26
const slug = entry.id;
27
const speakers = await getEntries(entry.data.speakers);
28
29
+// Sort speakers according to Issue #1282 rules
30
+speakers.sort((a, b) => {
31
+ const aNoPicAndBio = !a.data.avatar && !a.data.biography;
32
+ const bNoPicAndBio = !b.data.avatar && !b.data.biography;
33
+
34
+ if (aNoPicAndBio && !bNoPicAndBio) return 1;
35
+ if (!aNoPicAndBio && bNoPicAndBio) return -1;
36
37
+ // Otherwise, sort by first name (alphabetical)
38
+ return a.data.name.localeCompare(b.data.name);
39
+});
40
41
// Resolve session codes to session data
42
const resolveSessions = (codes: string[]) =>
43
codes.map((code) => sessions.find((s) => s.data.code === code)!);
0 commit comments