From 7fc76e034a1d1d22ac93ce1bfcaad798e431a415 Mon Sep 17 00:00:00 2001 From: svrnm Date: Mon, 22 Jan 2024 18:38:40 +0100 Subject: [PATCH] Registry: put 'offical' languages first in dropdown Signed-off-by: svrnm --- data/registry/tools-cpp-alpine-apk.yml | 2 +- .../ecosystem/registry/search-form.html | 30 +++++++++++++++---- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/data/registry/tools-cpp-alpine-apk.yml b/data/registry/tools-cpp-alpine-apk.yml index 0b7845584c97..a237f5e460f7 100644 --- a/data/registry/tools-cpp-alpine-apk.yml +++ b/data/registry/tools-cpp-alpine-apk.yml @@ -1,5 +1,5 @@ title: Alpine Linux Packages for OpenTelemetry C++ -registryType: core exporter +registryType: core language: cpp tags: - cpp diff --git a/layouts/shortcodes/ecosystem/registry/search-form.html b/layouts/shortcodes/ecosystem/registry/search-form.html index 5c78c66d4bb8..499239205a9f 100644 --- a/layouts/shortcodes/ecosystem/registry/search-form.html +++ b/layouts/shortcodes/ecosystem/registry/search-form.html @@ -6,16 +6,23 @@ {{ $languageNames.Set "js" "JavaScript" -}} {{ $languageNames.Set "php" "PHP" -}} +{{ $officialLanguages := slice "collector" "cpp" "erlang" "elixir" "dotnet" "go" "java" "js" "php" "python" "ruby" "rust" "swift" -}} + {{ $langs := slice -}} {{ range $registry -}} {{ $language := .language -}} - {{ $langs = $langs | append $language -}} + {{- $val := (dict + "name" .language + "isOfficial" (in $officialLanguages .language) + ) + -}} + {{ $langs = $langs | append $val -}} {{ if ne $language (lower $language) -}} {{ errorf "Language keys must be in lowercase. Registry entry '%s' has the following invalid key: %s" .title $language -}} {{ end -}} {{ end -}} -{{ $langs = $langs | uniq | sort -}} +{{ $langs = sort ($langs | uniq) "name" -}} {{ $types := slice -}} {{ range $registry -}} @@ -53,9 +60,22 @@