From 1c4f1acf4576acbd52c419ee6cd9a734d86b4650 Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Wed, 30 Oct 2024 12:43:21 -0700 Subject: [PATCH] Sort SPEC endorsers (#690) * Sort SPEC endorsers * Also sort endorsed-by logos --- layouts/partials/specs/spec_list.html | 14 ++++++++------ layouts/partials/specs/spec_meta.html | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/layouts/partials/specs/spec_list.html b/layouts/partials/specs/spec_list.html index 01df2ad..f37e9f8 100644 --- a/layouts/partials/specs/spec_list.html +++ b/layouts/partials/specs/spec_list.html @@ -20,12 +20,14 @@ DRAFT {{ else }} {{- $endorsed_by := index .Params "endorsed-by" }} - {{- range $idx, $el := $endorsed_by }} - {{ $project_page := $.GetPage (printf "core-projects/%s" $el) }} - {{ $url := $project_page.RelPermalink }} - - - + {{ with $endorsed_by }} + {{- range $idx, $el := sort $endorsed_by }} + {{ $project_page := $.GetPage (printf "core-projects/%s" $el) }} + {{ $url := $project_page.RelPermalink }} + + + + {{- end }} {{- end }} {{- end }} diff --git a/layouts/partials/specs/spec_meta.html b/layouts/partials/specs/spec_meta.html index dc07bf8..8084d73 100644 --- a/layouts/partials/specs/spec_meta.html +++ b/layouts/partials/specs/spec_meta.html @@ -16,7 +16,7 @@ {{- else if (eq $term "history") }} {{- $def = printf "https://github.com/scientific-python/specs/commits/main/%s" $filename | markdownify }} {{- else if and (eq $term "endorsed-by") (reflect.IsSlice $def) }} - {{- $def = apply $def "printf" "[%s](../core-projects/%s)" "." "." }} + {{- $def = apply (sort $def) "printf" "[%s](../core-projects/%s)" "." "." }} {{- $def = delimit $def ", " }} {{- $def = $def | markdownify }} {{- if ge (len $def) 1 -}}