From 069e11c2af33bb16d215d00580937b73fa6992cf Mon Sep 17 00:00:00 2001 From: Lukas Heumos Date: Sun, 23 Aug 2026 19:56:38 +0200 Subject: [PATCH] Sort tutorials by the registry's order key Every tutorial in the registry carries an order value and the schema documents it as "lower numbers mean earlier", but the listing rendered them in whatever order the JSON happened to be in. Getting started with AnnData was showing up last under Data structures, and Preprocessing, clustering and cell-type annotation last under scRNA-seq. Tutorials without an order key sort last, and equal values keep their registry order. Signed-off-by: Lukas Heumos --- layouts/learn/list.html | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/layouts/learn/list.html b/layouts/learn/list.html index eff578b..76cf8c5 100644 --- a/layouts/learn/list.html +++ b/layouts/learn/list.html @@ -28,6 +28,15 @@

Tutorials

{{ range $cat := $content.categories }} {{ range $catname, $catmore := $cat }} {{ $ts := where $content.tutorials "primary_category" $catname }} + {{/* Honour the registry's `order` key: lower comes first, no key comes last. + The index tiebreaker keeps equal-order tutorials in registry order. + */}} + {{ $ranked := slice }} + {{ range $i, $t := $ts }} + {{ $rank := add (mul (default 9999 $t.order) 1000) $i }} + {{ $ranked = $ranked | append (dict "rank" $rank "tutorial" $t) }} + {{ end }} + {{ $ts = apply (sort $ranked "rank") "index" "." "tutorial" }} {{ if (gt ($ts | len) 0) }}

{{ $catname }}

{{ $catmore.description }}